From c4c60e7aeb4247c18480032e3f40650f66e8e473 Mon Sep 17 00:00:00 2001 From: arlyon Date: Fri, 11 Oct 2024 00:28:48 +0000 Subject: [PATCH] feat: generate latest changes from OpenApi spec --- openapi/src/metadata.rs | 1 - openapi/version.json | 2 +- src/resources.rs | 3 - src/resources/generated.rs | 3 - src/resources/generated/account.rs | 1196 ++++++- src/resources/generated/account_link.rs | 3 +- src/resources/generated/account_session.rs | 254 +- src/resources/generated/api_errors.rs | 28 + src/resources/generated/application_fee.rs | 54 + src/resources/generated/apps_secret.rs | 1 + src/resources/generated/balance.rs | 18 +- .../generated/balance_transaction.rs | 3 +- src/resources/generated/bank_account.rs | 15 +- src/resources/generated/billing_alert.rs | 204 ++ .../generated/billing_alert_triggered.rs | 36 + .../billing_credit_balance_summary.rs | 40 + .../billing_credit_balance_transaction.rs | 193 ++ .../generated/billing_credit_grant.rs | 153 + .../billing_credit_grants_resource_amount.rs | 64 + src/resources/generated/billing_meter.rs | 229 ++ .../generated/billing_meter_event.rs | 48 + .../billing_meter_event_adjustment.rs | 114 + .../generated/billing_meter_event_summary.rs | 47 + .../generated/billing_portal_configuration.rs | 10 +- .../generated/billing_portal_session.rs | 4 +- src/resources/generated/capability.rs | 143 +- src/resources/generated/card.rs | 20 +- src/resources/generated/charge.rs | 354 +-- src/resources/generated/checkout_session.rs | 1178 ++++++- src/resources/generated/confirmation_token.rs | 452 +++ src/resources/generated/credit_note.rs | 109 +- .../generated/credit_note_line_item.rs | 59 +- src/resources/generated/customer.rs | 50 +- src/resources/generated/customer_session.rs | 463 ++- src/resources/generated/discount.rs | 3 + src/resources/generated/dispute.rs | 114 +- .../entitlements_active_entitlement.rs | 38 + ...entitlements_active_entitlement_summary.rs | 29 + ...ents_active_entitlement_summary_updated.rs | 10 + .../generated/entitlements_feature.rs | 45 + src/resources/generated/event.rs | 5 +- src/resources/generated/file.rs | 3 + src/resources/generated/file_link.rs | 3 +- .../financial_connections_account.rs | 10 +- ...connections_account_refreshed_ownership.rs | 10 + .../financial_connections_session.rs | 94 +- src/resources/generated/forwarding_request.rs | 179 ++ .../generated/identity_verification_report.rs | 213 +- .../identity_verification_session.rs | 73 +- src/resources/generated/invoice.rs | 736 ++++- src/resources/generated/invoice_overdue.rs | 10 + ...voice_payment_method_options_sepa_debit.rs | 10 + ..._payment_method_options_us_bank_account.rs | 62 + .../generated/invoice_rendering_template.rs | 174 ++ .../generated/invoice_will_be_due.rs | 10 + src/resources/generated/invoiceitem.rs | 23 +- ....rs => invoices_resource_shipping_cost.rs} | 11 +- .../generated/issuing_authorization.rs | 270 ++ src/resources/generated/issuing_card.rs | 113 +- src/resources/generated/issuing_cardholder.rs | 17 + src/resources/generated/issuing_dispute.rs | 113 + .../issuing_dispute_funds_rescinded.rs | 10 + .../issuing_personalization_design.rs | 232 ++ ...ssuing_personalization_design_activated.rs | 10 + ...uing_personalization_design_deactivated.rs | 10 + ...issuing_personalization_design_rejected.rs | 10 + .../issuing_personalization_design_updated.rs | 10 + .../generated/issuing_physical_bundle.rs | 232 ++ .../generated/issuing_transaction.rs | 95 +- src/resources/generated/item.rs | 3 +- src/resources/generated/line_item.rs | 77 +- .../linked_account_options_us_bank_account.rs | 50 + src/resources/generated/mandate.rs | 12 + src/resources/generated/margin.rs | 53 + ...nt_flows_private_payment_methods_alipay.rs | 10 + src/resources/generated/payment_intent.rs | 2075 +++++++++++-- src/resources/generated/payment_link.rs | 210 +- src/resources/generated/payment_method.rs | 2738 +++++------------ .../generated/payment_method_acss_debit.rs | 27 + .../generated/payment_method_affirm.rs | 10 + .../payment_method_afterpay_clearpay.rs | 10 + .../generated/payment_method_amazon_pay.rs | 10 + .../generated/payment_method_au_becs_debit.rs | 21 + .../generated/payment_method_bacs_debit.rs | 23 + .../generated/payment_method_bancontact.rs | 10 + .../generated/payment_method_blik.rs | 10 + .../generated/payment_method_boleto.rs | 13 + .../generated/payment_method_card.rs | 294 ++ .../generated/payment_method_card_present.rs | 126 + .../payment_method_card_present_networks.rs | 15 - .../generated/payment_method_cashapp.rs | 16 + .../generated/payment_method_configuration.rs | 797 ++++- .../payment_method_customer_balance.rs | 10 + .../payment_method_details_card_present.rs | 240 ++ ...ent_method_details_card_present_offline.rs | 52 + src/resources/generated/payment_method_eps.rs | 101 + src/resources/generated/payment_method_fpx.rs | 128 + .../generated/payment_method_giropay.rs | 10 + .../generated/payment_method_grabpay.rs | 10 + .../generated/payment_method_ideal.rs | 161 + .../payment_method_interac_present.rs | 117 + .../generated/payment_method_klarna.rs | 27 + .../generated/payment_method_konbini.rs | 10 + .../generated/payment_method_link.rs | 17 + .../generated/payment_method_mobilepay.rs | 10 + .../generated/payment_method_multibanco.rs | 10 + ...ent_method_options_card_present_routing.rs | 47 + .../generated/payment_method_oxxo.rs | 10 + src/resources/generated/payment_method_p24.rs | 95 + .../generated/payment_method_paynow.rs | 10 + .../generated/payment_method_paypal.rs | 21 + src/resources/generated/payment_method_pix.rs | 10 + .../generated/payment_method_promptpay.rs | 10 + .../generated/payment_method_revolut_pay.rs | 10 + .../generated/payment_method_sepa_debit.rs | 42 + .../generated/payment_method_sofort.rs | 13 + .../generated/payment_method_swish.rs | 10 + .../generated/payment_method_twint.rs | 10 + .../payment_method_us_bank_account.rs | 278 ++ .../generated/payment_method_wechat_pay.rs | 10 + src/resources/generated/payment_method_zip.rs | 10 + src/resources/generated/payout.rs | 14 +- src/resources/generated/person.rs | 19 +- src/resources/generated/plan.rs | 4 + src/resources/generated/platform_tax_fee.rs | 35 - src/resources/generated/price.rs | 15 +- src/resources/generated/product.rs | 81 +- src/resources/generated/product_feature.rs | 38 + src/resources/generated/promotion_code.rs | 1 + src/resources/generated/refund.rs | 10 +- src/resources/generated/review.rs | 1 + src/resources/generated/setup_attempt.rs | 18 +- src/resources/generated/setup_intent.rs | 369 ++- src/resources/generated/shipping_rate.rs | 4 - src/resources/generated/subscription.rs | 386 ++- src/resources/generated/subscription_item.rs | 62 +- .../generated/subscription_schedule.rs | 150 +- src/resources/generated/tax_calculation.rs | 11 +- .../generated/tax_calculation_line_item.rs | 1 + src/resources/generated/tax_id.rs | 36 +- .../tax_product_resource_customer_details.rs | 43 +- .../tax_product_resource_ship_from_details.rs | 13 + src/resources/generated/tax_rate.rs | 2 - src/resources/generated/tax_registration.rs | 80 + src/resources/generated/tax_settings.rs | 4 +- src/resources/generated/tax_transaction.rs | 9 +- .../generated/terminal_configuration.rs | 54 + .../generated/terminal_connection_token.rs | 4 +- src/resources/generated/terminal_location.rs | 2 + src/resources/generated/terminal_reader.rs | 28 +- .../generated/test_helpers_test_clock.rs | 15 + src/resources/generated/token.rs | 24 +- src/resources/generated/transfer.rs | 7 +- .../generated/treasury_financial_account.rs | 10 + .../generated/treasury_inbound_transfer.rs | 10 +- .../generated/treasury_outbound_payment.rs | 81 +- ...tbound_payment_tracking_details_updated.rs | 10 + .../generated/treasury_outbound_transfer.rs | 81 +- ...bound_transfer_tracking_details_updated.rs | 10 + .../generated/treasury_received_credit.rs | 3 + .../generated/treasury_received_debit.rs | 5 + .../generated/treasury_transaction.rs | 2 + .../generated/treasury_transaction_entry.rs | 1 + .../generated/usage_record_summary.rs | 2 + src/resources/generated/version.rs | 2 +- src/resources/generated/webhook_endpoint.rs | 54 +- 166 files changed, 15182 insertions(+), 3266 deletions(-) create mode 100644 src/resources/generated/billing_alert.rs create mode 100644 src/resources/generated/billing_alert_triggered.rs create mode 100644 src/resources/generated/billing_credit_balance_summary.rs create mode 100644 src/resources/generated/billing_credit_balance_transaction.rs create mode 100644 src/resources/generated/billing_credit_grant.rs create mode 100644 src/resources/generated/billing_credit_grants_resource_amount.rs create mode 100644 src/resources/generated/billing_meter.rs create mode 100644 src/resources/generated/billing_meter_event.rs create mode 100644 src/resources/generated/billing_meter_event_adjustment.rs create mode 100644 src/resources/generated/billing_meter_event_summary.rs create mode 100644 src/resources/generated/confirmation_token.rs create mode 100644 src/resources/generated/entitlements_active_entitlement.rs create mode 100644 src/resources/generated/entitlements_active_entitlement_summary.rs create mode 100644 src/resources/generated/entitlements_active_entitlement_summary_updated.rs create mode 100644 src/resources/generated/entitlements_feature.rs create mode 100644 src/resources/generated/financial_connections_account_refreshed_ownership.rs create mode 100644 src/resources/generated/forwarding_request.rs create mode 100644 src/resources/generated/invoice_overdue.rs create mode 100644 src/resources/generated/invoice_payment_method_options_sepa_debit.rs create mode 100644 src/resources/generated/invoice_rendering_template.rs create mode 100644 src/resources/generated/invoice_will_be_due.rs rename src/resources/generated/{invoices_shipping_cost.rs => invoices_resource_shipping_cost.rs} (96%) create mode 100644 src/resources/generated/issuing_dispute_funds_rescinded.rs create mode 100644 src/resources/generated/issuing_personalization_design.rs create mode 100644 src/resources/generated/issuing_personalization_design_activated.rs create mode 100644 src/resources/generated/issuing_personalization_design_deactivated.rs create mode 100644 src/resources/generated/issuing_personalization_design_rejected.rs create mode 100644 src/resources/generated/issuing_personalization_design_updated.rs create mode 100644 src/resources/generated/issuing_physical_bundle.rs create mode 100644 src/resources/generated/margin.rs create mode 100644 src/resources/generated/payment_flows_private_payment_methods_alipay.rs create mode 100644 src/resources/generated/payment_method_acss_debit.rs create mode 100644 src/resources/generated/payment_method_affirm.rs create mode 100644 src/resources/generated/payment_method_afterpay_clearpay.rs create mode 100644 src/resources/generated/payment_method_amazon_pay.rs create mode 100644 src/resources/generated/payment_method_au_becs_debit.rs create mode 100644 src/resources/generated/payment_method_bacs_debit.rs create mode 100644 src/resources/generated/payment_method_bancontact.rs create mode 100644 src/resources/generated/payment_method_blik.rs create mode 100644 src/resources/generated/payment_method_boleto.rs create mode 100644 src/resources/generated/payment_method_card.rs create mode 100644 src/resources/generated/payment_method_card_present.rs delete mode 100644 src/resources/generated/payment_method_card_present_networks.rs create mode 100644 src/resources/generated/payment_method_cashapp.rs create mode 100644 src/resources/generated/payment_method_customer_balance.rs create mode 100644 src/resources/generated/payment_method_details_card_present.rs create mode 100644 src/resources/generated/payment_method_details_card_present_offline.rs create mode 100644 src/resources/generated/payment_method_eps.rs create mode 100644 src/resources/generated/payment_method_fpx.rs create mode 100644 src/resources/generated/payment_method_giropay.rs create mode 100644 src/resources/generated/payment_method_grabpay.rs create mode 100644 src/resources/generated/payment_method_ideal.rs create mode 100644 src/resources/generated/payment_method_interac_present.rs create mode 100644 src/resources/generated/payment_method_klarna.rs create mode 100644 src/resources/generated/payment_method_konbini.rs create mode 100644 src/resources/generated/payment_method_link.rs create mode 100644 src/resources/generated/payment_method_mobilepay.rs create mode 100644 src/resources/generated/payment_method_multibanco.rs create mode 100644 src/resources/generated/payment_method_options_card_present_routing.rs create mode 100644 src/resources/generated/payment_method_oxxo.rs create mode 100644 src/resources/generated/payment_method_p24.rs create mode 100644 src/resources/generated/payment_method_paynow.rs create mode 100644 src/resources/generated/payment_method_paypal.rs create mode 100644 src/resources/generated/payment_method_pix.rs create mode 100644 src/resources/generated/payment_method_promptpay.rs create mode 100644 src/resources/generated/payment_method_revolut_pay.rs create mode 100644 src/resources/generated/payment_method_sepa_debit.rs create mode 100644 src/resources/generated/payment_method_sofort.rs create mode 100644 src/resources/generated/payment_method_swish.rs create mode 100644 src/resources/generated/payment_method_twint.rs create mode 100644 src/resources/generated/payment_method_us_bank_account.rs create mode 100644 src/resources/generated/payment_method_wechat_pay.rs create mode 100644 src/resources/generated/payment_method_zip.rs delete mode 100644 src/resources/generated/platform_tax_fee.rs create mode 100644 src/resources/generated/product_feature.rs create mode 100644 src/resources/generated/tax_product_resource_ship_from_details.rs create mode 100644 src/resources/generated/treasury_outbound_payment_tracking_details_updated.rs create mode 100644 src/resources/generated/treasury_outbound_transfer_tracking_details_updated.rs diff --git a/openapi/src/metadata.rs b/openapi/src/metadata.rs index f87a5a99b..4d793f87d 100644 --- a/openapi/src/metadata.rs +++ b/openapi/src/metadata.rs @@ -250,7 +250,6 @@ pub fn feature_groups() -> BTreeMap<&'static str, &'static str> { ("file_link", "core"), ("setup_intent", "core"), ("payout", "core"), - ("platform_tax_fee", "core"), ("product", "core"), ("refund", "core"), ("reserve_transaction", "core"), diff --git a/openapi/version.json b/openapi/version.json index 5e803d3a0..4918faba5 100644 --- a/openapi/version.json +++ b/openapi/version.json @@ -1,3 +1,3 @@ { - "version": "v814" + "version": "v1288" } \ No newline at end of file diff --git a/src/resources.rs b/src/resources.rs index 9ae2cbbc5..b7a6f12a6 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -144,7 +144,6 @@ pub use { 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::*, @@ -171,7 +170,6 @@ pub use { card::*, bank_account::*, payment_method::*, - payment_method_card_present_networks::*, source::*, }, }; @@ -230,7 +228,6 @@ pub use { invoice_payment_method_options_customer_balance::*, invoice_payment_method_options_us_bank_account::*, invoiceitem::*, - invoices_shipping_cost::*, line_item::*, plan::*, plan::PlanInterval, diff --git a/src/resources/generated.rs b/src/resources/generated.rs index 2656f058f..69ba19310 100644 --- a/src/resources/generated.rs +++ b/src/resources/generated.rs @@ -37,7 +37,6 @@ pub mod core { 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; @@ -59,7 +58,6 @@ pub mod payment { pub mod bank_account; pub mod card; pub mod payment_method; - pub mod payment_method_card_present_networks; pub mod source; } @@ -96,7 +94,6 @@ pub mod billing { 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; diff --git a/src/resources/generated/account.rs b/src/resources/generated/account.rs index bb3a6bb5b..e9b688818 100644 --- a/src/resources/generated/account.rs +++ b/src/resources/generated/account.rs @@ -28,7 +28,7 @@ pub struct Account { /// 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. + /// After you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions), this property is only returned for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub business_type: Option, @@ -67,7 +67,8 @@ pub struct Account { /// Whether account details have been submitted. /// - /// Standard accounts cannot receive payouts before this is true. + /// Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. + /// Accounts where this is false should be directed to [an onboarding flow](/connect/onboarding) to finish submitting account details. #[serde(skip_serializing_if = "Option::is_none")] pub details_submitted: Option, @@ -111,7 +112,7 @@ pub struct Account { /// The Stripe account type. /// - /// Can be `standard`, `express`, or `custom`. + /// Can be `standard`, `express`, `custom`, or `none`. #[serde(rename = "type")] #[serde(skip_serializing_if = "Option::is_none")] pub type_: Option, @@ -142,23 +143,22 @@ impl Account { 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. + /// Updates a connected account 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). + /// Any parameters not provided are left unchanged. For accounts where controller.requirement_collection is `application`, which includes Custom accounts, you can update any information on the account. For accounts where controller.requirement_collection is `stripe`, which includes Standard and Express accounts, you can update all information until you create an Account Link or Account Session to start Connect onboarding, after which some properties can no longer be updated. 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 { #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/accounts/{}", id), ¶ms) } - /// With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + /// With Connect, you can delete accounts you manage. /// - /// Accounts created using test-mode keys can be deleted at any time. + /// Test-mode accounts 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. + /// Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. + /// + /// Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when 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)) } @@ -184,7 +184,7 @@ pub struct BusinessProfile { /// currently working for the business. pub estimated_worker_count: Option, - /// [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). + /// [The merchant category code for the account](/connect/setting-mcc). /// /// MCCs are used to classify businesses based on the goods or services they provide. pub mcc: Option, @@ -219,7 +219,7 @@ pub struct BusinessProfile { #[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). + /// A non-negative integer representing the amount in the [smallest currency unit](/currencies#zero-decimal). pub amount: Option, /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. @@ -248,6 +248,10 @@ pub struct AccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub afterpay_clearpay_payments: Option, + /// The status of the AmazonPay capability of the account, or whether the account can directly process AmazonPay payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay_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, @@ -296,6 +300,10 @@ pub struct AccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub fpx_payments: Option, + /// The status of the GB customer_balance payments (GBP currency) capability of the account, or whether the account can directly process GB customer_balance charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub gb_bank_transfer_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, @@ -316,6 +324,10 @@ pub struct AccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub jcb_payments: Option, + /// The status of the Japanese customer_balance payments (JPY currency) capability of the account, or whether the account can directly process Japanese customer_balance charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub jp_bank_transfer_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, @@ -332,6 +344,18 @@ pub struct AccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub link_payments: Option, + /// The status of the MobilePay capability of the account, or whether the account can directly process MobilePay charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay_payments: Option, + + /// The status of the Multibanco payments capability of the account, or whether the account can directly process Multibanco charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco_payments: Option, + + /// The status of the Mexican customer_balance payments (MXN currency) capability of the account, or whether the account can directly process Mexican customer_balance charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub mx_bank_transfer_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, @@ -352,6 +376,10 @@ pub struct AccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub revolut_pay_payments: Option, + /// The status of the SEPA customer_balance payments (EUR currency) capability of the account, or whether the account can directly process SEPA customer_balance charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_bank_transfer_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, @@ -380,10 +408,18 @@ pub struct AccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub treasury: Option, + /// The status of the TWINT capability of the account, or whether the account can directly process TWINT charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint_payments: 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 US customer_balance payments (USD currency) capability of the account, or whether the account can directly process US customer_balance charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_transfer_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, @@ -421,16 +457,17 @@ pub struct AccountFutureRequirements { /// 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. + /// Fields that might become required depending on the results of verification or review. /// - /// Will be an empty array unless an asynchronous verification is pending. + /// It's an empty array unless an asynchronous verification is pending. /// If verification fails, these fields move to `eventually_due` or `currently_due`. + /// Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. 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). + /// A non-negative integer representing how much to charge in the [smallest currency unit](/currencies#zero-decimal). pub amount: i64, /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. @@ -473,10 +510,11 @@ pub struct AccountRequirements { /// 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. + /// Fields that might become required depending on the results of verification or review. /// - /// Will be an empty array unless an asynchronous verification is pending. + /// It's an empty array unless an asynchronous verification is pending. /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + /// Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. pub pending_verification: Option>, } @@ -638,22 +676,24 @@ pub struct PaymentsSettings { /// 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). + /// The Kana variation of `statement_descriptor` used for charges in Japan. + /// + /// Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). 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). + /// The Kanji variation of `statement_descriptor` used for charges in Japan. + /// + /// Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). 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). + /// The Kana variation of `statement_descriptor_prefix` used for card charges in Japan. /// - /// 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. + /// Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). 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). + /// The Kanji variation of `statement_descriptor_prefix` used for card charges in Japan. /// - /// 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. + /// Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). pub statement_descriptor_prefix_kanji: Option, } @@ -661,8 +701,8 @@ pub struct PaymentsSettings { 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`. + /// See [Understanding Connect account balances](/connect/account-balances) for details. + /// The default value is `false` when [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, otherwise `true`. pub debit_negative_balances: bool, pub schedule: TransferSchedule, @@ -720,12 +760,27 @@ pub struct AccountTermsOfService { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct AccountUnificationAccountController { + #[serde(skip_serializing_if = "Option::is_none")] + pub fees: Option, + /// `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, + #[serde(skip_serializing_if = "Option::is_none")] + pub losses: Option, + + /// A value indicating responsibility for collecting requirements on this account. + /// + /// Only returned when the Connect application retrieving the resource controls the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub requirement_collection: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stripe_dashboard: Option, + /// The controller type. /// /// Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. @@ -733,6 +788,27 @@ pub struct AccountUnificationAccountController { pub type_: AccountUnificationAccountControllerType, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct AccountUnificationAccountControllerFees { + /// A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account. + /// + /// Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). + pub payer: AccountUnificationAccountControllerFeesPayer, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct AccountUnificationAccountControllerLosses { + /// A value indicating who is liable when this account can't pay back negative balances from payments. + pub payments: AccountUnificationAccountControllerLossesPayments, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct AccountUnificationAccountControllerStripeDashboard { + /// A value indicating the Stripe dashboard this account has access to independent of the Connect application. + #[serde(rename = "type")] + pub type_: AccountUnificationAccountControllerStripeDashboardType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CardIssuingAccountTermsOfService { /// The Unix timestamp marking when the account representative accepted the service agreement. @@ -900,25 +976,29 @@ pub struct CreateAccount<'a> { /// 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. + /// Once you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes 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. + /// Each key of the dictionary represents a capability, and each capability + /// maps to its settings (for example, whether it has been requested or not). /// - /// 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. + /// Each capability is inactive until you have provided its specific requirements and Stripe has verified them. + /// An account might have some of its requested capabilities be active and some be inactive. Required when [account.controller.stripe_dashboard.type](/api/accounts/create#create_account-controller-dashboard-type) is `none`, which includes Custom accounts. #[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. + /// Once you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub company: Option, + /// A hash of configuration describing the account controller's attributes. + #[serde(skip_serializing_if = "Option::is_none")] + pub controller: 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. @@ -929,7 +1009,7 @@ pub struct CreateAccount<'a> { /// 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). + /// This must be a currency that [Stripe supports in the account's country](https://docs.stripe.com/payouts). #[serde(skip_serializing_if = "Option::is_none")] pub default_currency: Option, @@ -940,7 +1020,7 @@ pub struct CreateAccount<'a> { /// 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. + /// If [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, Stripe doesn't email the account without your consent. #[serde(skip_serializing_if = "Option::is_none")] pub email: Option<&'a str>, @@ -948,19 +1028,19 @@ pub struct CreateAccount<'a> { #[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). + /// A card or bank account to attach to the account for receiving [payouts](/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. + /// You can provide either a token, like the ones returned by [Stripe.js](/js), or a dictionary, as documented in the `external_account` parameter for [bank account](/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. + /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](/api#account_create_bank_account) or [card creation](/api#account_create_card) APIs. + /// After you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes 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. + /// Once you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub individual: Option, @@ -976,7 +1056,10 @@ pub struct CreateAccount<'a> { #[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. + /// Details on the account's acceptance of the [Stripe Services Agreement](/connect/updating-accounts#tos-acceptance). + /// + /// This property can only be updated for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + /// This property defaults to a `full` service agreement when empty. #[serde(skip_serializing_if = "Option::is_none")] pub tos_acceptance: Option, @@ -996,6 +1079,7 @@ impl<'a> CreateAccount<'a> { business_type: Default::default(), capabilities: Default::default(), company: Default::default(), + controller: Default::default(), country: Default::default(), default_currency: Default::default(), documents: Default::default(), @@ -1014,6 +1098,7 @@ impl<'a> CreateAccount<'a> { /// The parameters for `Account::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListAccounts<'a> { + /// Only return connected accounts that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, @@ -1072,28 +1157,28 @@ pub struct UpdateAccount<'a> { /// 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. + /// Once you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes 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. + /// Each key of the dictionary represents a capability, and each capability + /// maps to its settings (for example, whether it has been requested or not). /// - /// 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. + /// Each capability is inactive until you have provided its specific requirements and Stripe has verified them. + /// An account might have some of its requested capabilities be active and some be inactive. Required when [account.controller.stripe_dashboard.type](/api/accounts/create#create_account-controller-dashboard-type) is `none`, which includes Custom accounts. #[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. + /// Once you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes 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). + /// This must be a currency that [Stripe supports in the account's country](https://docs.stripe.com/payouts). #[serde(skip_serializing_if = "Option::is_none")] pub default_currency: Option, @@ -1104,7 +1189,7 @@ pub struct UpdateAccount<'a> { /// 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. + /// If [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, Stripe doesn't email the account without your consent. #[serde(skip_serializing_if = "Option::is_none")] pub email: Option<&'a str>, @@ -1112,19 +1197,19 @@ pub struct UpdateAccount<'a> { #[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). + /// A card or bank account to attach to the account for receiving [payouts](/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. + /// You can provide either a token, like the ones returned by [Stripe.js](/js), or a dictionary, as documented in the `external_account` parameter for [bank account](/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. + /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](/api#account_create_bank_account) or [card creation](/api#account_create_card) APIs. + /// After you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes 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. + /// Once you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub individual: Option, @@ -1140,7 +1225,10 @@ pub struct UpdateAccount<'a> { #[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. + /// Details on the account's acceptance of the [Stripe Services Agreement](/connect/updating-accounts#tos-acceptance). + /// + /// This property can only be updated for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + /// This property defaults to a `full` service agreement when empty. #[serde(skip_serializing_if = "Option::is_none")] pub tos_acceptance: Option, } @@ -1232,14 +1320,14 @@ pub struct CompanyParams { /// 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. + /// Set this Boolean to `true` after creating all the company's directors with [the Persons API](/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. + /// Set this Boolean to `true` after creating all the company's executives with [the Persons API](/api/persons) for accounts with a `relationship.executive` requirement. #[serde(skip_serializing_if = "Option::is_none")] pub executives_provided: Option, @@ -1265,7 +1353,7 @@ pub struct CompanyParams { /// 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. + /// Set this Boolean to `true` after creating all the company's owners with [the Persons API](/api/persons) for accounts with a `relationship.owner` requirement. #[serde(skip_serializing_if = "Option::is_none")] pub owners_provided: Option, @@ -1285,7 +1373,7 @@ pub struct CompanyParams { /// 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. + /// See [Business structure](/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, @@ -1323,6 +1411,10 @@ pub struct CreateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub afterpay_clearpay_payments: Option, + /// The amazon_pay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay_payments: Option, + /// The au_becs_debit_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub au_becs_debit_payments: Option, @@ -1371,6 +1463,10 @@ pub struct CreateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub fpx_payments: Option, + /// The gb_bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub gb_bank_transfer_payments: Option, + /// The giropay_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub giropay_payments: Option, @@ -1391,6 +1487,10 @@ pub struct CreateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub jcb_payments: Option, + /// The jp_bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub jp_bank_transfer_payments: Option, + /// The klarna_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub klarna_payments: Option, @@ -1407,6 +1507,18 @@ pub struct CreateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub link_payments: Option, + /// The mobilepay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay_payments: Option, + + /// The multibanco_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco_payments: Option, + + /// The mx_bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub mx_bank_transfer_payments: Option, + /// The oxxo_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub oxxo_payments: Option, @@ -1427,6 +1539,10 @@ pub struct CreateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub revolut_pay_payments: Option, + /// The sepa_bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_bank_transfer_payments: Option, + /// The sepa_debit_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub sepa_debit_payments: Option, @@ -1455,20 +1571,49 @@ pub struct CreateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub treasury: Option, + /// The twint_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint_payments: Option, + /// The us_bank_account_ach_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub us_bank_account_ach_payments: Option, + /// The us_bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_transfer_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 CreateAccountController { + /// A hash of configuration for who pays Stripe fees for product usage on this account. + #[serde(skip_serializing_if = "Option::is_none")] + pub fees: Option, + + /// A hash of configuration for products that have negative balance liability, and whether Stripe or a Connect application is responsible for them. + #[serde(skip_serializing_if = "Option::is_none")] + pub losses: Option, + + /// A value indicating responsibility for collecting updated information when requirements on the account are due or change. + /// + /// Defaults to `stripe`. + #[serde(skip_serializing_if = "Option::is_none")] + pub requirement_collection: Option, + + /// A hash of configuration for Stripe-hosted dashboards. + #[serde(skip_serializing_if = "Option::is_none")] + pub stripe_dashboard: 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. + /// 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 check. #[serde(skip_serializing_if = "Option::is_none")] pub bank_account_ownership_verification: Option, @@ -1506,11 +1651,11 @@ pub struct PersonParams { #[serde(skip_serializing_if = "Option::is_none")] pub address: Option
, - /// The Kana variation of the the individual's primary address (Japan only). + /// The Kana variation of 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). + /// The Kanji variation of the individual's primary address (Japan only). #[serde(skip_serializing_if = "Option::is_none")] pub address_kanji: Option
, @@ -1526,7 +1671,7 @@ pub struct PersonParams { #[serde(skip_serializing_if = "Option::is_none")] pub first_name: Option, - /// The Kana variation of the the individual's first name (Japan only). + /// The Kana variation of the individual's first name (Japan only). #[serde(skip_serializing_if = "Option::is_none")] pub first_name_kana: Option, @@ -1545,14 +1690,14 @@ pub struct PersonParams { /// 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). + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](/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). + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](/js/tokens/create_token?type=pii). #[serde(skip_serializing_if = "Option::is_none")] pub id_number_secondary: Option, @@ -1621,6 +1766,10 @@ pub struct UpdateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub afterpay_clearpay_payments: Option, + /// The amazon_pay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay_payments: Option, + /// The au_becs_debit_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub au_becs_debit_payments: Option, @@ -1669,6 +1818,10 @@ pub struct UpdateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub fpx_payments: Option, + /// The gb_bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub gb_bank_transfer_payments: Option, + /// The giropay_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub giropay_payments: Option, @@ -1689,6 +1842,10 @@ pub struct UpdateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub jcb_payments: Option, + /// The jp_bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub jp_bank_transfer_payments: Option, + /// The klarna_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub klarna_payments: Option, @@ -1705,6 +1862,18 @@ pub struct UpdateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub link_payments: Option, + /// The mobilepay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay_payments: Option, + + /// The multibanco_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco_payments: Option, + + /// The mx_bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub mx_bank_transfer_payments: Option, + /// The oxxo_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub oxxo_payments: Option, @@ -1725,6 +1894,10 @@ pub struct UpdateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub revolut_pay_payments: Option, + /// The sepa_bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_bank_transfer_payments: Option, + /// The sepa_debit_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub sepa_debit_payments: Option, @@ -1753,10 +1926,18 @@ pub struct UpdateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub treasury: Option, + /// The twint_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint_payments: Option, + /// The us_bank_account_ach_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub us_bank_account_ach_payments: Option, + /// The us_bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_transfer_payments: Option, + /// The zip_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub zip_payments: Option, @@ -1766,7 +1947,7 @@ pub struct UpdateAccountCapabilities { 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. + /// 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 check. #[serde(skip_serializing_if = "Option::is_none")] pub bank_account_ownership_verification: Option, @@ -1813,7 +1994,7 @@ pub struct AccountSettingsParamsBacsDebitPayments { #[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). + /// Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](/issuing/connect/tos_acceptance). #[serde(skip_serializing_if = "Option::is_none")] pub tos_acceptance: Option, } @@ -1928,6 +2109,16 @@ pub struct CreateAccountCapabilitiesAfterpayClearpayPayments { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountCapabilitiesAmazonPayPayments { + /// 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. @@ -2048,6 +2239,16 @@ pub struct CreateAccountCapabilitiesFpxPayments { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountCapabilitiesGbBankTransferPayments { + /// 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. @@ -2098,6 +2299,16 @@ pub struct CreateAccountCapabilitiesJcbPayments { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountCapabilitiesJpBankTransferPayments { + /// 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. @@ -2138,6 +2349,36 @@ pub struct CreateAccountCapabilitiesLinkPayments { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountCapabilitiesMobilepayPayments { + /// 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 CreateAccountCapabilitiesMultibancoPayments { + /// 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 CreateAccountCapabilitiesMxBankTransferPayments { + /// 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. @@ -2188,6 +2429,16 @@ pub struct CreateAccountCapabilitiesRevolutPayPayments { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountCapabilitiesSepaBankTransferPayments { + /// 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. @@ -2258,6 +2509,16 @@ pub struct CreateAccountCapabilitiesTreasury { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountCapabilitiesTwintPayments { + /// 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. @@ -2268,6 +2529,16 @@ pub struct CreateAccountCapabilitiesUsBankAccountAchPayments { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountCapabilitiesUsBankTransferPayments { + /// 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. @@ -2278,6 +2549,35 @@ pub struct CreateAccountCapabilitiesZipPayments { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountControllerFees { + /// A value indicating the responsible payer of Stripe fees on this account. + /// + /// Defaults to `account`. + /// Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). + #[serde(skip_serializing_if = "Option::is_none")] + pub payer: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountControllerLosses { + /// A value indicating who is liable when this account can't pay back negative balances resulting from payments. + /// + /// Defaults to `stripe`. + #[serde(skip_serializing_if = "Option::is_none")] + pub payments: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountControllerStripeDashboard { + /// Whether this account should have access to the full Stripe Dashboard (`full`), to the Express Dashboard (`express`), or to no Stripe-hosted dashboard (`none`). + /// + /// Defaults to `full`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: 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`. @@ -2329,17 +2629,23 @@ pub struct CreateAccountDocumentsProofOfRegistration { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentsSettingsParams { - /// The default text that appears on credit card statements when a charge is made. + /// The default text that appears on statements for non-card charges outside of Japan. /// - /// This field prefixes any dynamic `statement_descriptor` specified on the charge. + /// For card charges, if you don't set a `statement_descriptor_prefix`, this text is also used as the statement descriptor prefix. + /// In that case, if concatenating the statement descriptor suffix causes the combined statement descriptor to exceed 22 characters, we truncate the `statement_descriptor` text to limit the full descriptor to 22 characters. + /// For more information about statement descriptors and their requirements, see the [account settings documentation](https://docs.stripe.com/get-started/account/statement-descriptors). #[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). + /// The Kana variation of `statement_descriptor` used for charges in Japan. + /// + /// Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). #[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). + /// The Kanji variation of `statement_descriptor` used for charges in Japan. + /// + /// Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor_kanji: Option, } @@ -2348,13 +2654,13 @@ pub struct PaymentsSettingsParams { 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). + /// For details, see [Understanding Connect Account Balances](/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. + /// For details, see our [Setting Bank and Debit Card Payouts](/connect/bank-transfers#payout-information) documentation. #[serde(skip_serializing_if = "Option::is_none")] pub schedule: Option, @@ -2459,6 +2765,16 @@ pub struct UpdateAccountCapabilitiesAfterpayClearpayPayments { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateAccountCapabilitiesAmazonPayPayments { + /// 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. @@ -2579,6 +2895,16 @@ pub struct UpdateAccountCapabilitiesFpxPayments { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateAccountCapabilitiesGbBankTransferPayments { + /// 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. @@ -2630,7 +2956,7 @@ pub struct UpdateAccountCapabilitiesJcbPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesKlarnaPayments { +pub struct UpdateAccountCapabilitiesJpBankTransferPayments { /// Passing true requests the capability for the account, if it is not already requested. /// /// A requested capability may not immediately become active. @@ -2640,7 +2966,7 @@ pub struct UpdateAccountCapabilitiesKlarnaPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesKonbiniPayments { +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. @@ -2650,7 +2976,7 @@ pub struct UpdateAccountCapabilitiesKonbiniPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesLegacyPayments { +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. @@ -2660,7 +2986,7 @@ pub struct UpdateAccountCapabilitiesLegacyPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesLinkPayments { +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. @@ -2670,7 +2996,7 @@ pub struct UpdateAccountCapabilitiesLinkPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesOxxoPayments { +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. @@ -2680,7 +3006,7 @@ pub struct UpdateAccountCapabilitiesOxxoPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesP24Payments { +pub struct UpdateAccountCapabilitiesMobilepayPayments { /// Passing true requests the capability for the account, if it is not already requested. /// /// A requested capability may not immediately become active. @@ -2690,7 +3016,7 @@ pub struct UpdateAccountCapabilitiesP24Payments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesPaynowPayments { +pub struct UpdateAccountCapabilitiesMultibancoPayments { /// Passing true requests the capability for the account, if it is not already requested. /// /// A requested capability may not immediately become active. @@ -2700,7 +3026,7 @@ pub struct UpdateAccountCapabilitiesPaynowPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesPromptpayPayments { +pub struct UpdateAccountCapabilitiesMxBankTransferPayments { /// Passing true requests the capability for the account, if it is not already requested. /// /// A requested capability may not immediately become active. @@ -2710,7 +3036,7 @@ pub struct UpdateAccountCapabilitiesPromptpayPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesRevolutPayPayments { +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. @@ -2720,7 +3046,7 @@ pub struct UpdateAccountCapabilitiesRevolutPayPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesSepaDebitPayments { +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. @@ -2730,7 +3056,7 @@ pub struct UpdateAccountCapabilitiesSepaDebitPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesSofortPayments { +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. @@ -2740,7 +3066,7 @@ pub struct UpdateAccountCapabilitiesSofortPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesSwishPayments { +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. @@ -2750,7 +3076,7 @@ pub struct UpdateAccountCapabilitiesSwishPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTaxReportingUs1099K { +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. @@ -2760,7 +3086,7 @@ pub struct UpdateAccountCapabilitiesTaxReportingUs1099K { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTaxReportingUs1099Misc { +pub struct UpdateAccountCapabilitiesSepaBankTransferPayments { /// Passing true requests the capability for the account, if it is not already requested. /// /// A requested capability may not immediately become active. @@ -2770,7 +3096,7 @@ pub struct UpdateAccountCapabilitiesTaxReportingUs1099Misc { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTransfers { +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. @@ -2780,7 +3106,7 @@ pub struct UpdateAccountCapabilitiesTransfers { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTreasury { +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. @@ -2790,7 +3116,7 @@ pub struct UpdateAccountCapabilitiesTreasury { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesUsBankAccountAchPayments { +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. @@ -2800,7 +3126,7 @@ pub struct UpdateAccountCapabilitiesUsBankAccountAchPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesZipPayments { +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. @@ -2810,7 +3136,77 @@ pub struct UpdateAccountCapabilitiesZipPayments { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsBankAccountOwnershipVerification { +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 UpdateAccountCapabilitiesTwintPayments { + /// 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 UpdateAccountCapabilitiesUsBankTransferPayments { + /// 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>, @@ -2910,7 +3306,7 @@ pub struct TransferScheduleParams { /// 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). + /// [Learn more about controlling payout delay days](/connect/manage-payout-schedule). #[serde(skip_serializing_if = "Option::is_none")] pub delay_days: Option, @@ -3081,6 +3477,42 @@ impl std::default::Default for AccountCapabilitiesAfterpayClearpayPayments { } } +/// An enum representing the possible values of an `AccountCapabilities`'s `amazon_pay_payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilitiesAmazonPayPayments { + Active, + Inactive, + Pending, +} + +impl AccountCapabilitiesAmazonPayPayments { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilitiesAmazonPayPayments::Active => "active", + AccountCapabilitiesAmazonPayPayments::Inactive => "inactive", + AccountCapabilitiesAmazonPayPayments::Pending => "pending", + } + } +} + +impl AsRef for AccountCapabilitiesAmazonPayPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilitiesAmazonPayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilitiesAmazonPayPayments { + 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")] @@ -3405,6 +3837,42 @@ impl std::default::Default for AccountCapabilitiesFpxPayments { } } +/// An enum representing the possible values of an `AccountCapabilities`'s `gb_bank_transfer_payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilitiesGbBankTransferPayments { + Active, + Inactive, + Pending, +} + +impl AccountCapabilitiesGbBankTransferPayments { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilitiesGbBankTransferPayments::Active => "active", + AccountCapabilitiesGbBankTransferPayments::Inactive => "inactive", + AccountCapabilitiesGbBankTransferPayments::Pending => "pending", + } + } +} + +impl AsRef for AccountCapabilitiesGbBankTransferPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilitiesGbBankTransferPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilitiesGbBankTransferPayments { + 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")] @@ -3549,6 +4017,42 @@ impl std::default::Default for AccountCapabilitiesIndiaInternationalPayments { } } +/// An enum representing the possible values of an `AccountCapabilities`'s `jp_bank_transfer_payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilitiesJpBankTransferPayments { + Active, + Inactive, + Pending, +} + +impl AccountCapabilitiesJpBankTransferPayments { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilitiesJpBankTransferPayments::Active => "active", + AccountCapabilitiesJpBankTransferPayments::Inactive => "inactive", + AccountCapabilitiesJpBankTransferPayments::Pending => "pending", + } + } +} + +impl AsRef for AccountCapabilitiesJpBankTransferPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilitiesJpBankTransferPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilitiesJpBankTransferPayments { + 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")] @@ -3657,6 +4161,114 @@ impl std::default::Default for AccountCapabilitiesLinkPayments { } } +/// An enum representing the possible values of an `AccountCapabilities`'s `mobilepay_payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilitiesMobilepayPayments { + Active, + Inactive, + Pending, +} + +impl AccountCapabilitiesMobilepayPayments { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilitiesMobilepayPayments::Active => "active", + AccountCapabilitiesMobilepayPayments::Inactive => "inactive", + AccountCapabilitiesMobilepayPayments::Pending => "pending", + } + } +} + +impl AsRef for AccountCapabilitiesMobilepayPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilitiesMobilepayPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilitiesMobilepayPayments { + fn default() -> Self { + Self::Active + } +} + +/// An enum representing the possible values of an `AccountCapabilities`'s `multibanco_payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilitiesMultibancoPayments { + Active, + Inactive, + Pending, +} + +impl AccountCapabilitiesMultibancoPayments { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilitiesMultibancoPayments::Active => "active", + AccountCapabilitiesMultibancoPayments::Inactive => "inactive", + AccountCapabilitiesMultibancoPayments::Pending => "pending", + } + } +} + +impl AsRef for AccountCapabilitiesMultibancoPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilitiesMultibancoPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilitiesMultibancoPayments { + fn default() -> Self { + Self::Active + } +} + +/// An enum representing the possible values of an `AccountCapabilities`'s `mx_bank_transfer_payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilitiesMxBankTransferPayments { + Active, + Inactive, + Pending, +} + +impl AccountCapabilitiesMxBankTransferPayments { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilitiesMxBankTransferPayments::Active => "active", + AccountCapabilitiesMxBankTransferPayments::Inactive => "inactive", + AccountCapabilitiesMxBankTransferPayments::Pending => "pending", + } + } +} + +impl AsRef for AccountCapabilitiesMxBankTransferPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilitiesMxBankTransferPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilitiesMxBankTransferPayments { + 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")] @@ -3837,6 +4449,42 @@ impl std::default::Default for AccountCapabilitiesRevolutPayPayments { } } +/// An enum representing the possible values of an `AccountCapabilities`'s `sepa_bank_transfer_payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilitiesSepaBankTransferPayments { + Active, + Inactive, + Pending, +} + +impl AccountCapabilitiesSepaBankTransferPayments { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilitiesSepaBankTransferPayments::Active => "active", + AccountCapabilitiesSepaBankTransferPayments::Inactive => "inactive", + AccountCapabilitiesSepaBankTransferPayments::Pending => "pending", + } + } +} + +impl AsRef for AccountCapabilitiesSepaBankTransferPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilitiesSepaBankTransferPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilitiesSepaBankTransferPayments { + 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")] @@ -3981,6 +4629,42 @@ impl std::default::Default for AccountCapabilitiesTreasury { } } +/// An enum representing the possible values of an `AccountCapabilities`'s `twint_payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilitiesTwintPayments { + Active, + Inactive, + Pending, +} + +impl AccountCapabilitiesTwintPayments { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilitiesTwintPayments::Active => "active", + AccountCapabilitiesTwintPayments::Inactive => "inactive", + AccountCapabilitiesTwintPayments::Pending => "pending", + } + } +} + +impl AsRef for AccountCapabilitiesTwintPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilitiesTwintPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilitiesTwintPayments { + 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")] @@ -4017,6 +4701,42 @@ impl std::default::Default for AccountCapabilitiesUsBankAccountAchPayments { } } +/// An enum representing the possible values of an `AccountCapabilities`'s `us_bank_transfer_payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilitiesUsBankTransferPayments { + Active, + Inactive, + Pending, +} + +impl AccountCapabilitiesUsBankTransferPayments { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilitiesUsBankTransferPayments::Active => "active", + AccountCapabilitiesUsBankTransferPayments::Inactive => "inactive", + AccountCapabilitiesUsBankTransferPayments::Pending => "pending", + } + } +} + +impl AsRef for AccountCapabilitiesUsBankTransferPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilitiesUsBankTransferPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilitiesUsBankTransferPayments { + 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")] @@ -4138,6 +4858,7 @@ pub enum AccountRequirementsErrorCode { VerificationFailedKeyedMatch, VerificationFailedNameMatch, VerificationFailedOther, + VerificationFailedRepresentativeAuthority, VerificationFailedResidentialAddress, VerificationFailedTaxIdMatch, VerificationFailedTaxIdNotIssued, @@ -4145,6 +4866,8 @@ pub enum AccountRequirementsErrorCode { VerificationMissingExecutives, VerificationMissingOwners, VerificationRequiresAdditionalMemorandumOfAssociations, + VerificationRequiresAdditionalProofOfRegistration, + VerificationSupportability, } impl AccountRequirementsErrorCode { @@ -4230,6 +4953,7 @@ impl AccountRequirementsErrorCode { AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", + AccountRequirementsErrorCode::VerificationFailedRepresentativeAuthority => "verification_failed_representative_authority", AccountRequirementsErrorCode::VerificationFailedResidentialAddress => "verification_failed_residential_address", AccountRequirementsErrorCode::VerificationFailedTaxIdMatch => "verification_failed_tax_id_match", AccountRequirementsErrorCode::VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued", @@ -4237,6 +4961,8 @@ impl AccountRequirementsErrorCode { AccountRequirementsErrorCode::VerificationMissingExecutives => "verification_missing_executives", AccountRequirementsErrorCode::VerificationMissingOwners => "verification_missing_owners", AccountRequirementsErrorCode::VerificationRequiresAdditionalMemorandumOfAssociations => "verification_requires_additional_memorandum_of_associations", + AccountRequirementsErrorCode::VerificationRequiresAdditionalProofOfRegistration => "verification_requires_additional_proof_of_registration", + AccountRequirementsErrorCode::VerificationSupportability => "verification_supportability", } } } @@ -4294,6 +5020,150 @@ impl std::default::Default for AccountType { } } +/// An enum representing the possible values of an `AccountUnificationAccountControllerFees`'s `payer` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountUnificationAccountControllerFeesPayer { + Account, + Application, + ApplicationCustom, + ApplicationExpress, +} + +impl AccountUnificationAccountControllerFeesPayer { + pub fn as_str(self) -> &'static str { + match self { + AccountUnificationAccountControllerFeesPayer::Account => "account", + AccountUnificationAccountControllerFeesPayer::Application => "application", + AccountUnificationAccountControllerFeesPayer::ApplicationCustom => "application_custom", + AccountUnificationAccountControllerFeesPayer::ApplicationExpress => { + "application_express" + } + } + } +} + +impl AsRef for AccountUnificationAccountControllerFeesPayer { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountUnificationAccountControllerFeesPayer { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountUnificationAccountControllerFeesPayer { + fn default() -> Self { + Self::Account + } +} + +/// An enum representing the possible values of an `AccountUnificationAccountControllerLosses`'s `payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountUnificationAccountControllerLossesPayments { + Application, + Stripe, +} + +impl AccountUnificationAccountControllerLossesPayments { + pub fn as_str(self) -> &'static str { + match self { + AccountUnificationAccountControllerLossesPayments::Application => "application", + AccountUnificationAccountControllerLossesPayments::Stripe => "stripe", + } + } +} + +impl AsRef for AccountUnificationAccountControllerLossesPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountUnificationAccountControllerLossesPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountUnificationAccountControllerLossesPayments { + fn default() -> Self { + Self::Application + } +} + +/// An enum representing the possible values of an `AccountUnificationAccountController`'s `requirement_collection` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountUnificationAccountControllerRequirementCollection { + Application, + Stripe, +} + +impl AccountUnificationAccountControllerRequirementCollection { + pub fn as_str(self) -> &'static str { + match self { + AccountUnificationAccountControllerRequirementCollection::Application => "application", + AccountUnificationAccountControllerRequirementCollection::Stripe => "stripe", + } + } +} + +impl AsRef for AccountUnificationAccountControllerRequirementCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountUnificationAccountControllerRequirementCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountUnificationAccountControllerRequirementCollection { + fn default() -> Self { + Self::Application + } +} + +/// An enum representing the possible values of an `AccountUnificationAccountControllerStripeDashboard`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountUnificationAccountControllerStripeDashboardType { + Express, + Full, + None, +} + +impl AccountUnificationAccountControllerStripeDashboardType { + pub fn as_str(self) -> &'static str { + match self { + AccountUnificationAccountControllerStripeDashboardType::Express => "express", + AccountUnificationAccountControllerStripeDashboardType::Full => "full", + AccountUnificationAccountControllerStripeDashboardType::None => "none", + } + } +} + +impl AsRef for AccountUnificationAccountControllerStripeDashboardType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountUnificationAccountControllerStripeDashboardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountUnificationAccountControllerStripeDashboardType { + fn default() -> Self { + Self::Express + } +} + /// 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")] @@ -4520,6 +5390,144 @@ impl std::default::Default for CompanyStructure { } } +/// An enum representing the possible values of an `CreateAccountControllerFees`'s `payer` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateAccountControllerFeesPayer { + Account, + Application, +} + +impl CreateAccountControllerFeesPayer { + pub fn as_str(self) -> &'static str { + match self { + CreateAccountControllerFeesPayer::Account => "account", + CreateAccountControllerFeesPayer::Application => "application", + } + } +} + +impl AsRef for CreateAccountControllerFeesPayer { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateAccountControllerFeesPayer { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateAccountControllerFeesPayer { + fn default() -> Self { + Self::Account + } +} + +/// An enum representing the possible values of an `CreateAccountControllerLosses`'s `payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateAccountControllerLossesPayments { + Application, + Stripe, +} + +impl CreateAccountControllerLossesPayments { + pub fn as_str(self) -> &'static str { + match self { + CreateAccountControllerLossesPayments::Application => "application", + CreateAccountControllerLossesPayments::Stripe => "stripe", + } + } +} + +impl AsRef for CreateAccountControllerLossesPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateAccountControllerLossesPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateAccountControllerLossesPayments { + fn default() -> Self { + Self::Application + } +} + +/// An enum representing the possible values of an `CreateAccountController`'s `requirement_collection` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateAccountControllerRequirementCollection { + Application, + Stripe, +} + +impl CreateAccountControllerRequirementCollection { + pub fn as_str(self) -> &'static str { + match self { + CreateAccountControllerRequirementCollection::Application => "application", + CreateAccountControllerRequirementCollection::Stripe => "stripe", + } + } +} + +impl AsRef for CreateAccountControllerRequirementCollection { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateAccountControllerRequirementCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateAccountControllerRequirementCollection { + fn default() -> Self { + Self::Application + } +} + +/// An enum representing the possible values of an `CreateAccountControllerStripeDashboard`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateAccountControllerStripeDashboardType { + Express, + Full, + None, +} + +impl CreateAccountControllerStripeDashboardType { + pub fn as_str(self) -> &'static str { + match self { + CreateAccountControllerStripeDashboardType::Express => "express", + CreateAccountControllerStripeDashboardType::Full => "full", + CreateAccountControllerStripeDashboardType::None => "none", + } + } +} + +impl AsRef for CreateAccountControllerStripeDashboardType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateAccountControllerStripeDashboardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateAccountControllerStripeDashboardType { + fn default() -> Self { + Self::Express + } +} + /// 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")] diff --git a/src/resources/generated/account_link.rs b/src/resources/generated/account_link.rs index b3c2c91f6..a8f80687d 100644 --- a/src/resources/generated/account_link.rs +++ b/src/resources/generated/account_link.rs @@ -98,7 +98,8 @@ 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, + #[serde(skip_serializing_if = "Option::is_none")] + pub fields: Option, /// Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. /// diff --git a/src/resources/generated/account_session.rs b/src/resources/generated/account_session.rs index ec2521b5d..5a2e21558 100644 --- a/src/resources/generated/account_session.rs +++ b/src/resources/generated/account_session.rs @@ -52,13 +52,46 @@ impl Object for AccountSession { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct ConnectEmbeddedAccountSessionCreateComponents { - pub account_onboarding: ConnectEmbeddedBaseConfigClaim, + pub account_management: ConnectEmbeddedAccountConfigClaim, - pub payment_details: ConnectEmbeddedPaymentsConfig, + pub account_onboarding: ConnectEmbeddedAccountConfigClaim, - pub payments: ConnectEmbeddedPaymentsConfig, + pub balances: ConnectEmbeddedPayoutsConfigClaim, - pub payouts: ConnectEmbeddedPayoutsConfig, + pub documents: ConnectEmbeddedBaseConfigClaim, + + pub notification_banner: ConnectEmbeddedAccountConfigClaim, + + pub payment_details: ConnectEmbeddedPaymentsConfigClaim, + + pub payments: ConnectEmbeddedPaymentsConfigClaim, + + pub payouts: ConnectEmbeddedPayoutsConfigClaim, + + pub payouts_list: ConnectEmbeddedBaseConfigClaim, + + pub tax_registrations: ConnectEmbeddedBaseConfigClaim, + + pub tax_settings: ConnectEmbeddedBaseConfigClaim, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConnectEmbeddedAccountConfigClaim { + + /// Whether the embedded component is enabled. + pub enabled: bool, + + pub features: ConnectEmbeddedAccountFeaturesClaim, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConnectEmbeddedAccountFeaturesClaim { + + /// Whether to allow platforms to control bank account collection for their connected accounts. + /// + /// This feature can only be false for custom accounts (or accounts where the platform is compliance owner). + /// Otherwise, bank account collection is determined by compliance requirements. + pub external_account_collection: bool, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -75,7 +108,7 @@ pub struct ConnectEmbeddedBaseFeatures { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectEmbeddedPaymentsConfig { +pub struct ConnectEmbeddedPaymentsConfigClaim { /// Whether the embedded component is enabled. pub enabled: bool, @@ -91,6 +124,11 @@ pub struct ConnectEmbeddedPaymentsFeatures { /// This is `true` by default. pub capture_payments: bool, + /// Whether to allow connected accounts to manage destination charges that are created on behalf of them. + /// + /// This is `false` by default. + pub destination_on_behalf_of_charge_management: bool, + /// Whether to allow responding to disputes, including submitting evidence and accepting disputes. /// /// This is `true` by default. @@ -103,7 +141,7 @@ pub struct ConnectEmbeddedPaymentsFeatures { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectEmbeddedPayoutsConfig { +pub struct ConnectEmbeddedPayoutsConfigClaim { /// Whether the embedded component is enabled. pub enabled: bool, @@ -119,6 +157,12 @@ pub struct ConnectEmbeddedPayoutsFeatures { /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. pub edit_payout_schedule: bool, + /// Whether to allow platforms to control bank account collection for their connected accounts. + /// + /// This feature can only be false for custom accounts (or accounts where the platform is compliance owner). + /// Otherwise, bank account collection is determined by compliance requirements. + pub external_account_collection: bool, + /// Whether to allow creation of instant payouts. /// /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. @@ -160,10 +204,26 @@ impl<'a> CreateAccountSession<'a> { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateAccountSessionComponents { + /// Configuration for the account management embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_management: Option, + /// Configuration for the account onboarding embedded component. #[serde(skip_serializing_if = "Option::is_none")] pub account_onboarding: Option, + /// Configuration for the balances embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub balances: Option, + + /// Configuration for the documents embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option, + + /// Configuration for the notification banner embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub notification_banner: Option, + /// Configuration for the payment details embedded component. #[serde(skip_serializing_if = "Option::is_none")] pub payment_details: Option, @@ -175,6 +235,29 @@ pub struct CreateAccountSessionComponents { /// Configuration for the payouts embedded component. #[serde(skip_serializing_if = "Option::is_none")] pub payouts: Option, + + /// Configuration for the payouts list embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts_list: Option, + + /// Configuration for the tax registrations embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_registrations: Option, + + /// Configuration for the tax settings embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_settings: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsAccountManagement { + + /// 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)] @@ -188,6 +271,39 @@ pub struct CreateAccountSessionComponentsAccountOnboarding { pub features: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsBalances { + + /// 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 CreateAccountSessionComponentsDocuments { + + /// 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 CreateAccountSessionComponentsNotificationBanner { + + /// 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 { @@ -221,8 +337,103 @@ pub struct CreateAccountSessionComponentsPayouts { pub features: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsPayoutsList { + + /// 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 CreateAccountSessionComponentsTaxRegistrations { + + /// 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 CreateAccountSessionComponentsTaxSettings { + + /// 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 CreateAccountSessionComponentsAccountManagementFeatures { + + /// Whether to allow platforms to control bank account collection for their connected accounts. + /// + /// This feature can only be false for custom accounts (or accounts where the platform is compliance owner). + /// Otherwise, bank account collection is determined by compliance requirements. + #[serde(skip_serializing_if = "Option::is_none")] + pub external_account_collection: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateAccountSessionComponentsAccountOnboardingFeatures { + + /// Whether to allow platforms to control bank account collection for their connected accounts. + /// + /// This feature can only be false for custom accounts (or accounts where the platform is compliance owner). + /// Otherwise, bank account collection is determined by compliance requirements. + #[serde(skip_serializing_if = "Option::is_none")] + pub external_account_collection: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsBalancesFeatures { + + /// 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 platforms to control bank account collection for their connected accounts. + /// + /// This feature can only be false for custom accounts (or accounts where the platform is compliance owner). + /// Otherwise, bank account collection is determined by compliance requirements. + #[serde(skip_serializing_if = "Option::is_none")] + pub external_account_collection: 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, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsDocumentsFeatures { +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsNotificationBannerFeatures { + + /// Whether to allow platforms to control bank account collection for their connected accounts. + /// + /// This feature can only be false for custom accounts (or accounts where the platform is compliance owner). + /// Otherwise, bank account collection is determined by compliance requirements. + #[serde(skip_serializing_if = "Option::is_none")] + pub external_account_collection: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -234,6 +445,12 @@ pub struct CreateAccountSessionComponentsPaymentDetailsFeatures { #[serde(skip_serializing_if = "Option::is_none")] pub capture_payments: Option, + /// Whether to allow connected accounts to manage destination charges that are created on behalf of them. + /// + /// This is `false` by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_on_behalf_of_charge_management: Option, + /// Whether to allow responding to disputes, including submitting evidence and accepting disputes. /// /// This is `true` by default. @@ -256,6 +473,12 @@ pub struct CreateAccountSessionComponentsPaymentsFeatures { #[serde(skip_serializing_if = "Option::is_none")] pub capture_payments: Option, + /// Whether to allow connected accounts to manage destination charges that are created on behalf of them. + /// + /// This is `false` by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_on_behalf_of_charge_management: Option, + /// Whether to allow responding to disputes, including submitting evidence and accepting disputes. /// /// This is `true` by default. @@ -278,6 +501,13 @@ pub struct CreateAccountSessionComponentsPayoutsFeatures { #[serde(skip_serializing_if = "Option::is_none")] pub edit_payout_schedule: Option, + /// Whether to allow platforms to control bank account collection for their connected accounts. + /// + /// This feature can only be false for custom accounts (or accounts where the platform is compliance owner). + /// Otherwise, bank account collection is determined by compliance requirements. + #[serde(skip_serializing_if = "Option::is_none")] + pub external_account_collection: Option, + /// Whether to allow creation of instant payouts. /// /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. @@ -290,3 +520,15 @@ pub struct CreateAccountSessionComponentsPayoutsFeatures { #[serde(skip_serializing_if = "Option::is_none")] pub standard_payouts: Option, } + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsPayoutsListFeatures { +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsTaxRegistrationsFeatures { +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsTaxSettingsFeatures { +} diff --git a/src/resources/generated/api_errors.rs b/src/resources/generated/api_errors.rs index ba4195c7b..503e376c6 100644 --- a/src/resources/generated/api_errors.rs +++ b/src/resources/generated/api_errors.rs @@ -103,6 +103,7 @@ pub enum ApiErrorsCode { ChargeAlreadyRefunded, ChargeDisputed, ChargeExceedsSourceLimit, + ChargeExceedsTransactionLimit, ChargeExpiredForCapture, ChargeInvalidParameter, ChargeNotRefundable, @@ -118,6 +119,10 @@ pub enum ApiErrorsCode { ExpiredCard, FinancialConnectionsAccountInactive, FinancialConnectionsNoSuccessfulTransactionRefresh, + ForwardingApiInactive, + ForwardingApiInvalidParameter, + ForwardingApiUpstreamConnectionError, + ForwardingApiUpstreamConnectionTimeout, IdempotencyKeyInUse, IncorrectAddress, IncorrectCvc, @@ -136,6 +141,7 @@ pub enum ApiErrorsCode { InvalidCvc, InvalidExpiryMonth, InvalidExpiryYear, + InvalidMandateReferencePrefixFormat, InvalidNumber, InvalidSourceUsage, InvalidTaxLocation, @@ -213,6 +219,7 @@ pub enum ApiErrorsCode { SetupIntentMandateInvalid, SetupIntentSetupAttemptExpired, SetupIntentUnexpectedState, + ShippingAddressInvalid, ShippingCalculationFailed, SkuInactive, StateUnsupported, @@ -223,6 +230,8 @@ pub enum ApiErrorsCode { TerminalLocationCountryUnsupported, TerminalReaderBusy, TerminalReaderHardwareFault, + TerminalReaderInvalidLocationForActivation, + TerminalReaderInvalidLocationForPayment, TerminalReaderOffline, TerminalReaderTimeout, TestmodeChargesOnly, @@ -275,6 +284,7 @@ impl ApiErrorsCode { ApiErrorsCode::ChargeAlreadyRefunded => "charge_already_refunded", ApiErrorsCode::ChargeDisputed => "charge_disputed", ApiErrorsCode::ChargeExceedsSourceLimit => "charge_exceeds_source_limit", + ApiErrorsCode::ChargeExceedsTransactionLimit => "charge_exceeds_transaction_limit", ApiErrorsCode::ChargeExpiredForCapture => "charge_expired_for_capture", ApiErrorsCode::ChargeInvalidParameter => "charge_invalid_parameter", ApiErrorsCode::ChargeNotRefundable => "charge_not_refundable", @@ -294,6 +304,14 @@ impl ApiErrorsCode { ApiErrorsCode::FinancialConnectionsNoSuccessfulTransactionRefresh => { "financial_connections_no_successful_transaction_refresh" } + ApiErrorsCode::ForwardingApiInactive => "forwarding_api_inactive", + ApiErrorsCode::ForwardingApiInvalidParameter => "forwarding_api_invalid_parameter", + ApiErrorsCode::ForwardingApiUpstreamConnectionError => { + "forwarding_api_upstream_connection_error" + } + ApiErrorsCode::ForwardingApiUpstreamConnectionTimeout => { + "forwarding_api_upstream_connection_timeout" + } ApiErrorsCode::IdempotencyKeyInUse => "idempotency_key_in_use", ApiErrorsCode::IncorrectAddress => "incorrect_address", ApiErrorsCode::IncorrectCvc => "incorrect_cvc", @@ -312,6 +330,9 @@ impl ApiErrorsCode { ApiErrorsCode::InvalidCvc => "invalid_cvc", ApiErrorsCode::InvalidExpiryMonth => "invalid_expiry_month", ApiErrorsCode::InvalidExpiryYear => "invalid_expiry_year", + ApiErrorsCode::InvalidMandateReferencePrefixFormat => { + "invalid_mandate_reference_prefix_format" + } ApiErrorsCode::InvalidNumber => "invalid_number", ApiErrorsCode::InvalidSourceUsage => "invalid_source_usage", ApiErrorsCode::InvalidTaxLocation => "invalid_tax_location", @@ -423,6 +444,7 @@ impl ApiErrorsCode { ApiErrorsCode::SetupIntentMandateInvalid => "setup_intent_mandate_invalid", ApiErrorsCode::SetupIntentSetupAttemptExpired => "setup_intent_setup_attempt_expired", ApiErrorsCode::SetupIntentUnexpectedState => "setup_intent_unexpected_state", + ApiErrorsCode::ShippingAddressInvalid => "shipping_address_invalid", ApiErrorsCode::ShippingCalculationFailed => "shipping_calculation_failed", ApiErrorsCode::SkuInactive => "sku_inactive", ApiErrorsCode::StateUnsupported => "state_unsupported", @@ -435,6 +457,12 @@ impl ApiErrorsCode { } ApiErrorsCode::TerminalReaderBusy => "terminal_reader_busy", ApiErrorsCode::TerminalReaderHardwareFault => "terminal_reader_hardware_fault", + ApiErrorsCode::TerminalReaderInvalidLocationForActivation => { + "terminal_reader_invalid_location_for_activation" + } + ApiErrorsCode::TerminalReaderInvalidLocationForPayment => { + "terminal_reader_invalid_location_for_payment" + } ApiErrorsCode::TerminalReaderOffline => "terminal_reader_offline", ApiErrorsCode::TerminalReaderTimeout => "terminal_reader_timeout", ApiErrorsCode::TestmodeChargesOnly => "testmode_charges_only", diff --git a/src/resources/generated/application_fee.rs b/src/resources/generated/application_fee.rs index 08954d596..722b5d829 100644 --- a/src/resources/generated/application_fee.rs +++ b/src/resources/generated/application_fee.rs @@ -47,6 +47,11 @@ pub struct ApplicationFee { /// Must be a [supported currency](https://stripe.com/docs/currencies). pub currency: Currency, + /// Polymorphic source of the application fee. + /// + /// Includes the ID of the object the application fee was created from. + pub fee_source: 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, @@ -95,6 +100,21 @@ impl Object for ApplicationFee { } } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PlatformEarningFeeSource { + /// Charge ID that created this application fee. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option, + + /// Payout ID that created this application fee. + #[serde(skip_serializing_if = "Option::is_none")] + pub payout: Option, + + /// Type of object that created the application fee, either `charge` or `payout`. + #[serde(rename = "type")] + pub type_: PlatformEarningFeeSourceType, +} + /// The parameters for `ApplicationFee::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListApplicationFees<'a> { @@ -102,6 +122,7 @@ pub struct ListApplicationFees<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub charge: Option, + /// Only return applications fees that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, @@ -148,3 +169,36 @@ impl Paginable for ListApplicationFees<'_> { self.starting_after = Some(item.id()); } } +/// An enum representing the possible values of an `PlatformEarningFeeSource`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PlatformEarningFeeSourceType { + Charge, + Payout, +} + +impl PlatformEarningFeeSourceType { + pub fn as_str(self) -> &'static str { + match self { + PlatformEarningFeeSourceType::Charge => "charge", + PlatformEarningFeeSourceType::Payout => "payout", + } + } +} + +impl AsRef for PlatformEarningFeeSourceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PlatformEarningFeeSourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PlatformEarningFeeSourceType { + fn default() -> Self { + Self::Charge + } +} diff --git a/src/resources/generated/apps_secret.rs b/src/resources/generated/apps_secret.rs index 41af70203..b658d5366 100644 --- a/src/resources/generated/apps_secret.rs +++ b/src/resources/generated/apps_secret.rs @@ -31,6 +31,7 @@ pub struct AppsSecret { pub name: String, /// The plaintext secret value to be stored. + #[serde(skip_serializing_if = "Option::is_none")] pub payload: Option, pub scope: SecretServiceResourceScope, diff --git a/src/resources/generated/balance.rs b/src/resources/generated/balance.rs index fa9738044..eff672cb8 100644 --- a/src/resources/generated/balance.rs +++ b/src/resources/generated/balance.rs @@ -17,7 +17,7 @@ pub struct Balance { /// 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. + /// Funds held due to negative balances on connected accounts where [account.controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes 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")] @@ -71,6 +71,10 @@ pub struct BalanceAmountNet { /// Must be a [supported currency](https://stripe.com/docs/currencies). pub currency: Currency, + /// Breakdown of balance by destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub net_available: Option>, + #[serde(skip_serializing_if = "Option::is_none")] pub source_types: Option, } @@ -80,3 +84,15 @@ pub struct BalanceDetail { /// Funds that are available for use. pub available: Vec, } + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BalanceNetAvailable { + /// Net balance amount, subtracting fees from platform-set pricing. + pub amount: i64, + + /// ID of the external account for this net balance (not expandable). + pub destination: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub source_types: Option, +} diff --git a/src/resources/generated/balance_transaction.rs b/src/resources/generated/balance_transaction.rs index 629dbe1d5..9cd8af274 100644 --- a/src/resources/generated/balance_transaction.rs +++ b/src/resources/generated/balance_transaction.rs @@ -131,7 +131,7 @@ pub struct Fee { /// Often useful for displaying to users. pub description: Option, - /// Type of the fee, one of: `application_fee`, `stripe_fee` or `tax`. + /// Type of the fee, one of: `application_fee`, `payment_method_passthrough_fee`, `stripe_fee` or `tax`. #[serde(rename = "type")] pub type_: FeeType, } @@ -139,6 +139,7 @@ pub struct Fee { /// The parameters for `BalanceTransaction::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListBalanceTransactions<'a> { + /// Only return transactions that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, diff --git a/src/resources/generated/bank_account.rs b/src/resources/generated/bank_account.rs index 5a845ec68..a4b13ae61 100644 --- a/src/resources/generated/bank_account.rs +++ b/src/resources/generated/bank_account.rs @@ -100,8 +100,8 @@ pub struct BankAccount { /// 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`. + /// If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. + /// In the US and 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")] @@ -133,10 +133,11 @@ pub struct ExternalAccountRequirements { /// 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. + /// Fields that might become required depending on the results of verification or review. /// - /// Will be an empty array unless an asynchronous verification is pending. + /// It's an empty array unless an asynchronous verification is pending. /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + /// Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. pub pending_verification: Option>, } @@ -237,6 +238,7 @@ pub enum AccountRequirementsErrorCode { VerificationFailedKeyedMatch, VerificationFailedNameMatch, VerificationFailedOther, + VerificationFailedRepresentativeAuthority, VerificationFailedResidentialAddress, VerificationFailedTaxIdMatch, VerificationFailedTaxIdNotIssued, @@ -244,6 +246,8 @@ pub enum AccountRequirementsErrorCode { VerificationMissingExecutives, VerificationMissingOwners, VerificationRequiresAdditionalMemorandumOfAssociations, + VerificationRequiresAdditionalProofOfRegistration, + VerificationSupportability, } impl AccountRequirementsErrorCode { @@ -329,6 +333,7 @@ impl AccountRequirementsErrorCode { AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", + AccountRequirementsErrorCode::VerificationFailedRepresentativeAuthority => "verification_failed_representative_authority", AccountRequirementsErrorCode::VerificationFailedResidentialAddress => "verification_failed_residential_address", AccountRequirementsErrorCode::VerificationFailedTaxIdMatch => "verification_failed_tax_id_match", AccountRequirementsErrorCode::VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued", @@ -336,6 +341,8 @@ impl AccountRequirementsErrorCode { AccountRequirementsErrorCode::VerificationMissingExecutives => "verification_missing_executives", AccountRequirementsErrorCode::VerificationMissingOwners => "verification_missing_owners", AccountRequirementsErrorCode::VerificationRequiresAdditionalMemorandumOfAssociations => "verification_requires_additional_memorandum_of_associations", + AccountRequirementsErrorCode::VerificationRequiresAdditionalProofOfRegistration => "verification_requires_additional_proof_of_registration", + AccountRequirementsErrorCode::VerificationSupportability => "verification_supportability", } } } diff --git a/src/resources/generated/billing_alert.rs b/src/resources/generated/billing_alert.rs new file mode 100644 index 000000000..ec9403c92 --- /dev/null +++ b/src/resources/generated/billing_alert.rs @@ -0,0 +1,204 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{BillingAlertId}; +use crate::params::{Expandable, Object}; +use crate::resources::{BillingMeter, Customer}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "ThresholdsResourceAlert". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingAlert { + /// Unique identifier for the object. + pub id: BillingAlertId, + + /// Defines the type of the alert. + pub alert_type: BillingAlertAlertType, + + /// 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 alert. + /// + /// This can be active, inactive or archived. + pub status: Option, + + /// Title of the alert. + pub title: String, + + /// Encapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://stripe.com/docs/api/billing/meter). + pub usage_threshold: Option, +} + +impl Object for BillingAlert { + type Id = BillingAlertId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "billing.alert" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ThresholdsResourceUsageThresholdConfig { + + /// The filters allow limiting the scope of this usage alert. + /// + /// You can only specify up to one filter at this time. + pub filters: Option>, + + /// The value at which this alert will trigger. + pub gte: i64, + + /// The [Billing Meter](/api/billing/meter) ID whose usage is monitored. + pub meter: Expandable, + + /// Defines how the alert will behave. + pub recurrence: ThresholdsResourceUsageThresholdConfigRecurrence, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ThresholdsResourceUsageAlertFilter { + + /// Limit the scope of the alert to this customer ID. + pub customer: Option>, + + #[serde(rename = "type")] + pub type_: ThresholdsResourceUsageAlertFilterType, +} + +/// An enum representing the possible values of an `BillingAlert`'s `alert_type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingAlertAlertType { + UsageThreshold, +} + +impl BillingAlertAlertType { + pub fn as_str(self) -> &'static str { + match self { + BillingAlertAlertType::UsageThreshold => "usage_threshold", + } + } +} + +impl AsRef for BillingAlertAlertType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingAlertAlertType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingAlertAlertType { + fn default() -> Self { + Self::UsageThreshold + } +} + +/// An enum representing the possible values of an `BillingAlert`'s `status` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingAlertStatus { + Active, + Archived, + Inactive, +} + +impl BillingAlertStatus { + pub fn as_str(self) -> &'static str { + match self { + BillingAlertStatus::Active => "active", + BillingAlertStatus::Archived => "archived", + BillingAlertStatus::Inactive => "inactive", + } + } +} + +impl AsRef for BillingAlertStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingAlertStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingAlertStatus { + fn default() -> Self { + Self::Active + } +} + +/// An enum representing the possible values of an `ThresholdsResourceUsageAlertFilter`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum ThresholdsResourceUsageAlertFilterType { + Customer, +} + +impl ThresholdsResourceUsageAlertFilterType { + pub fn as_str(self) -> &'static str { + match self { + ThresholdsResourceUsageAlertFilterType::Customer => "customer", + } + } +} + +impl AsRef for ThresholdsResourceUsageAlertFilterType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for ThresholdsResourceUsageAlertFilterType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for ThresholdsResourceUsageAlertFilterType { + fn default() -> Self { + Self::Customer + } +} + +/// An enum representing the possible values of an `ThresholdsResourceUsageThresholdConfig`'s `recurrence` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum ThresholdsResourceUsageThresholdConfigRecurrence { + OneTime, +} + +impl ThresholdsResourceUsageThresholdConfigRecurrence { + pub fn as_str(self) -> &'static str { + match self { + ThresholdsResourceUsageThresholdConfigRecurrence::OneTime => "one_time", + } + } +} + +impl AsRef for ThresholdsResourceUsageThresholdConfigRecurrence { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for ThresholdsResourceUsageThresholdConfigRecurrence { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for ThresholdsResourceUsageThresholdConfigRecurrence { + fn default() -> Self { + Self::OneTime + } +} diff --git a/src/resources/generated/billing_alert_triggered.rs b/src/resources/generated/billing_alert_triggered.rs new file mode 100644 index 000000000..26a6040ba --- /dev/null +++ b/src/resources/generated/billing_alert_triggered.rs @@ -0,0 +1,36 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::params::{Object, Timestamp}; +use crate::resources::{BillingAlert}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "ThresholdsResourceAlert". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingAlertTriggered { + + pub alert: BillingAlert, + + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: Timestamp, + + /// ID of customer for which the alert triggered. + 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, + + /// The value triggering the alert. + pub value: i64, +} + +impl Object for BillingAlertTriggered { + type Id = (); + fn id(&self) -> Self::Id {} + fn object(&self) -> &'static str { + "billing.alert_triggered" + } +} diff --git a/src/resources/generated/billing_credit_balance_summary.rs b/src/resources/generated/billing_credit_balance_summary.rs new file mode 100644 index 000000000..e56784abb --- /dev/null +++ b/src/resources/generated/billing_credit_balance_summary.rs @@ -0,0 +1,40 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::params::{Expandable, Object}; +use crate::resources::{BillingCreditGrantsResourceAmount, Customer}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "CreditBalanceSummary". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingCreditBalanceSummary { + + /// The credit balances. + /// + /// One entry per credit grant currency. + /// If a customer only has credit grants in a single currency, then this will have a single balance entry. + pub balances: Vec, + + /// The customer the balance is for. + pub customer: 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 BillingCreditBalanceSummary { + type Id = (); + fn id(&self) -> Self::Id {} + fn object(&self) -> &'static str { + "billing.credit_balance_summary" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreditBalance { + + pub available_balance: BillingCreditGrantsResourceAmount, + + pub ledger_balance: BillingCreditGrantsResourceAmount, +} diff --git a/src/resources/generated/billing_credit_balance_transaction.rs b/src/resources/generated/billing_credit_balance_transaction.rs new file mode 100644 index 000000000..4fad5f564 --- /dev/null +++ b/src/resources/generated/billing_credit_balance_transaction.rs @@ -0,0 +1,193 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{BillingCreditBalanceTransactionId}; +use crate::params::{Expandable, Object, Timestamp}; +use crate::resources::{BillingCreditGrant, BillingCreditGrantsResourceAmount, Invoice, TestHelpersTestClock}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "CreditBalanceTransaction". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingCreditBalanceTransaction { + /// Unique identifier for the object. + pub id: BillingCreditBalanceTransactionId, + + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: Timestamp, + + /// Credit details for this balance transaction. + /// + /// Only present if type is `credit`. + pub credit: Option, + + /// The credit grant associated with this balance transaction. + pub credit_grant: Expandable, + + /// Debit details for this balance transaction. + /// + /// Only present if type is `debit`. + pub debit: Option, + + /// The effective time of this balance transaction. + pub effective_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, + + /// ID of the test clock this credit balance transaction belongs to. + pub test_clock: Option>, + + /// The type of balance transaction (credit or debit). + #[serde(rename = "type")] + pub type_: Option, +} + +impl Object for BillingCreditBalanceTransaction { + type Id = BillingCreditBalanceTransactionId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "billing.credit_balance_transaction" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingCreditGrantsResourceBalanceCredit { + + pub amount: BillingCreditGrantsResourceAmount, + + /// The type of credit transaction. + #[serde(rename = "type")] + pub type_: BillingCreditGrantsResourceBalanceCreditType, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingCreditGrantsResourceBalanceDebit { + + pub amount: BillingCreditGrantsResourceAmount, + + /// Details of how the credits were applied to an invoice. + /// + /// Only present if `type` is `credits_applied`. + pub credits_applied: Option, + + /// The type of debit transaction. + #[serde(rename = "type")] + pub type_: BillingCreditGrantsResourceBalanceDebitType, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingCreditGrantsResourceBalanceCreditsApplied { + + /// The invoice to which the credits were applied. + pub invoice: Expandable, + + /// The invoice line item to which the credits were applied. + pub invoice_line_item: String, +} + +/// An enum representing the possible values of an `BillingCreditBalanceTransaction`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingCreditBalanceTransactionType { + Credit, + Debit, +} + +impl BillingCreditBalanceTransactionType { + pub fn as_str(self) -> &'static str { + match self { + BillingCreditBalanceTransactionType::Credit => "credit", + BillingCreditBalanceTransactionType::Debit => "debit", + } + } +} + +impl AsRef for BillingCreditBalanceTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingCreditBalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingCreditBalanceTransactionType { + fn default() -> Self { + Self::Credit + } +} + +/// An enum representing the possible values of an `BillingCreditGrantsResourceBalanceCredit`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingCreditGrantsResourceBalanceCreditType { + CreditsGranted, +} + +impl BillingCreditGrantsResourceBalanceCreditType { + pub fn as_str(self) -> &'static str { + match self { + BillingCreditGrantsResourceBalanceCreditType::CreditsGranted => "credits_granted", + } + } +} + +impl AsRef for BillingCreditGrantsResourceBalanceCreditType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingCreditGrantsResourceBalanceCreditType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingCreditGrantsResourceBalanceCreditType { + fn default() -> Self { + Self::CreditsGranted + } +} + +/// An enum representing the possible values of an `BillingCreditGrantsResourceBalanceDebit`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingCreditGrantsResourceBalanceDebitType { + CreditsApplied, + CreditsExpired, + CreditsVoided, +} + +impl BillingCreditGrantsResourceBalanceDebitType { + pub fn as_str(self) -> &'static str { + match self { + BillingCreditGrantsResourceBalanceDebitType::CreditsApplied => "credits_applied", + BillingCreditGrantsResourceBalanceDebitType::CreditsExpired => "credits_expired", + BillingCreditGrantsResourceBalanceDebitType::CreditsVoided => "credits_voided", + } + } +} + +impl AsRef for BillingCreditGrantsResourceBalanceDebitType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingCreditGrantsResourceBalanceDebitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingCreditGrantsResourceBalanceDebitType { + fn default() -> Self { + Self::CreditsApplied + } +} diff --git a/src/resources/generated/billing_credit_grant.rs b/src/resources/generated/billing_credit_grant.rs new file mode 100644 index 000000000..619617598 --- /dev/null +++ b/src/resources/generated/billing_credit_grant.rs @@ -0,0 +1,153 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{BillingCreditGrantId}; +use crate::params::{Expandable, Metadata, Object, Timestamp}; +use crate::resources::{BillingCreditGrantsResourceAmount, Customer, TestHelpersTestClock}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "CreditGrant". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingCreditGrant { + /// Unique identifier for the object. + pub id: BillingCreditGrantId, + + pub amount: BillingCreditGrantsResourceAmount, + + pub applicability_config: BillingCreditGrantsResourceApplicabilityConfig, + + /// The category of this credit grant. + pub category: BillingCreditGrantCategory, + + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: Timestamp, + + /// Id of the customer to whom the credit was granted. + pub customer: Expandable, + + /// The time when the credit becomes effective i.e when it is eligible to be used. + pub effective_at: Option, + + /// The time when the credit will expire. + /// + /// If not present, the credit will never expire. + 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, + + /// Set of [key-value pairs](https://stripe.com/docs/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 descriptive name shown in dashboard and on invoices. + pub name: Option, + + /// ID of the test clock this credit grant belongs to. + pub test_clock: Option>, + + /// Time at which the object was last updated. + /// + /// Measured in seconds since the Unix epoch. + pub updated: Timestamp, + + /// The time when this credit grant was voided. + /// + /// If not present, the credit grant hasn't been voided. + pub voided_at: Option, +} + +impl Object for BillingCreditGrant { + type Id = BillingCreditGrantId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "billing.credit_grant" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingCreditGrantsResourceApplicabilityConfig { + + pub scope: BillingCreditGrantsResourceScope, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingCreditGrantsResourceScope { + + /// The price type to which credit grants can apply to. + /// + /// We currently only support `metered` price type. + pub price_type: BillingCreditGrantsResourceScopePriceType, +} + +/// An enum representing the possible values of an `BillingCreditGrant`'s `category` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingCreditGrantCategory { + Paid, + Promotional, +} + +impl BillingCreditGrantCategory { + pub fn as_str(self) -> &'static str { + match self { + BillingCreditGrantCategory::Paid => "paid", + BillingCreditGrantCategory::Promotional => "promotional", + } + } +} + +impl AsRef for BillingCreditGrantCategory { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingCreditGrantCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingCreditGrantCategory { + fn default() -> Self { + Self::Paid + } +} + +/// An enum representing the possible values of an `BillingCreditGrantsResourceScope`'s `price_type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingCreditGrantsResourceScopePriceType { + Metered, +} + +impl BillingCreditGrantsResourceScopePriceType { + pub fn as_str(self) -> &'static str { + match self { + BillingCreditGrantsResourceScopePriceType::Metered => "metered", + } + } +} + +impl AsRef for BillingCreditGrantsResourceScopePriceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingCreditGrantsResourceScopePriceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingCreditGrantsResourceScopePriceType { + fn default() -> Self { + Self::Metered + } +} diff --git a/src/resources/generated/billing_credit_grants_resource_amount.rs b/src/resources/generated/billing_credit_grants_resource_amount.rs new file mode 100644 index 000000000..7010e441b --- /dev/null +++ b/src/resources/generated/billing_credit_grants_resource_amount.rs @@ -0,0 +1,64 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::resources::{Currency}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "BillingCreditGrantsResourceAmount". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingCreditGrantsResourceAmount { + + /// The monetary amount. + pub monetary: Option, + + /// The type of this amount. + /// + /// We currently only support `monetary` credits. + #[serde(rename = "type")] + pub type_: BillingCreditGrantsResourceAmountType, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingCreditGrantsResourceMonetaryAmount { + + /// Three-letter [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 positive integer representing the amount. + pub value: i64, +} + +/// An enum representing the possible values of an `BillingCreditGrantsResourceAmount`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingCreditGrantsResourceAmountType { + Monetary, +} + +impl BillingCreditGrantsResourceAmountType { + pub fn as_str(self) -> &'static str { + match self { + BillingCreditGrantsResourceAmountType::Monetary => "monetary", + } + } +} + +impl AsRef for BillingCreditGrantsResourceAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingCreditGrantsResourceAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingCreditGrantsResourceAmountType { + fn default() -> Self { + Self::Monetary + } +} diff --git a/src/resources/generated/billing_meter.rs b/src/resources/generated/billing_meter.rs new file mode 100644 index 000000000..5cc2bc21d --- /dev/null +++ b/src/resources/generated/billing_meter.rs @@ -0,0 +1,229 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{BillingMeterId}; +use crate::params::{Object, Timestamp}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "BillingMeter". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingMeter { + /// Unique identifier for the object. + pub id: BillingMeterId, + + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: Timestamp, + + pub customer_mapping: BillingMeterResourceCustomerMappingSettings, + + pub default_aggregation: BillingMeterResourceAggregationSettings, + + /// The meter's name. + pub display_name: String, + + /// The name of the meter event to record usage for. + /// + /// Corresponds with the `event_name` field on meter events. + pub event_name: String, + + /// The time window to pre-aggregate meter events for, if any. + pub event_time_window: 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 meter's status. + pub status: BillingMeterStatus, + + pub status_transitions: BillingMeterResourceBillingMeterStatusTransitions, + + /// Time at which the object was last updated. + /// + /// Measured in seconds since the Unix epoch. + pub updated: Timestamp, + + pub value_settings: BillingMeterResourceBillingMeterValue, +} + +impl Object for BillingMeter { + type Id = BillingMeterId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "billing.meter" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingMeterResourceAggregationSettings { + + /// Specifies how events are aggregated. + pub formula: BillingMeterResourceAggregationSettingsFormula, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingMeterResourceBillingMeterStatusTransitions { + + /// The time the meter was deactivated, if any. + /// + /// Measured in seconds since Unix epoch. + pub deactivated_at: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingMeterResourceBillingMeterValue { + + /// The key in the meter event payload to use as the value for this meter. + pub event_payload_key: String, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingMeterResourceCustomerMappingSettings { + + /// The key in the meter event payload to use for mapping the event to a customer. + pub event_payload_key: String, + + /// The method for mapping a meter event to a customer. + #[serde(rename = "type")] + pub type_: BillingMeterResourceCustomerMappingSettingsType, +} + +/// An enum representing the possible values of an `BillingMeter`'s `event_time_window` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingMeterEventTimeWindow { + Day, + Hour, +} + +impl BillingMeterEventTimeWindow { + pub fn as_str(self) -> &'static str { + match self { + BillingMeterEventTimeWindow::Day => "day", + BillingMeterEventTimeWindow::Hour => "hour", + } + } +} + +impl AsRef for BillingMeterEventTimeWindow { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingMeterEventTimeWindow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingMeterEventTimeWindow { + fn default() -> Self { + Self::Day + } +} + +/// An enum representing the possible values of an `BillingMeterResourceAggregationSettings`'s `formula` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingMeterResourceAggregationSettingsFormula { + Count, + Sum, +} + +impl BillingMeterResourceAggregationSettingsFormula { + pub fn as_str(self) -> &'static str { + match self { + BillingMeterResourceAggregationSettingsFormula::Count => "count", + BillingMeterResourceAggregationSettingsFormula::Sum => "sum", + } + } +} + +impl AsRef for BillingMeterResourceAggregationSettingsFormula { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingMeterResourceAggregationSettingsFormula { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingMeterResourceAggregationSettingsFormula { + fn default() -> Self { + Self::Count + } +} + +/// An enum representing the possible values of an `BillingMeterResourceCustomerMappingSettings`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingMeterResourceCustomerMappingSettingsType { + ById, +} + +impl BillingMeterResourceCustomerMappingSettingsType { + pub fn as_str(self) -> &'static str { + match self { + BillingMeterResourceCustomerMappingSettingsType::ById => "by_id", + } + } +} + +impl AsRef for BillingMeterResourceCustomerMappingSettingsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingMeterResourceCustomerMappingSettingsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingMeterResourceCustomerMappingSettingsType { + fn default() -> Self { + Self::ById + } +} + +/// An enum representing the possible values of an `BillingMeter`'s `status` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingMeterStatus { + Active, + Inactive, +} + +impl BillingMeterStatus { + pub fn as_str(self) -> &'static str { + match self { + BillingMeterStatus::Active => "active", + BillingMeterStatus::Inactive => "inactive", + } + } +} + +impl AsRef for BillingMeterStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingMeterStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingMeterStatus { + fn default() -> Self { + Self::Active + } +} diff --git a/src/resources/generated/billing_meter_event.rs b/src/resources/generated/billing_meter_event.rs new file mode 100644 index 000000000..ebf0948de --- /dev/null +++ b/src/resources/generated/billing_meter_event.rs @@ -0,0 +1,48 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::params::{Object, Timestamp}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "BillingMeterEvent". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingMeterEvent { + + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: Timestamp, + + /// The name of the meter event. + /// + /// Corresponds with the `event_name` field on a meter. + pub event_name: String, + + /// A unique identifier for the event. + pub identifier: 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 payload of the event. + /// + /// This contains the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). + /// Read more about the [payload](https://stripe.com/docs/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). + pub payload: String, + + /// The timestamp passed in when creating the event. + /// + /// Measured in seconds since the Unix epoch. + pub timestamp: Timestamp, +} + +impl Object for BillingMeterEvent { + type Id = (); + fn id(&self) -> Self::Id {} + fn object(&self) -> &'static str { + "billing.meter_event" + } +} diff --git a/src/resources/generated/billing_meter_event_adjustment.rs b/src/resources/generated/billing_meter_event_adjustment.rs new file mode 100644 index 000000000..eda992212 --- /dev/null +++ b/src/resources/generated/billing_meter_event_adjustment.rs @@ -0,0 +1,114 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::params::{Object}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "BillingMeterEventAdjustment". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingMeterEventAdjustment { + + /// Specifies which event to cancel. + pub cancel: Option, + + /// The name of the meter event. + /// + /// Corresponds with the `event_name` field on a meter. + pub event_name: 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 meter event adjustment's status. + pub status: BillingMeterEventAdjustmentStatus, + + /// Specifies whether to cancel a single event or a range of events for a time period. + /// + /// Time period cancellation is not supported yet. + #[serde(rename = "type")] + pub type_: BillingMeterEventAdjustmentType, +} + +impl Object for BillingMeterEventAdjustment { + type Id = (); + fn id(&self) -> Self::Id {} + fn object(&self) -> &'static str { + "billing.meter_event_adjustment" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingMeterResourceBillingMeterEventAdjustmentCancel { + + /// Unique identifier for the event. + pub identifier: Option, +} + +/// An enum representing the possible values of an `BillingMeterEventAdjustment`'s `status` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingMeterEventAdjustmentStatus { + Complete, + Pending, +} + +impl BillingMeterEventAdjustmentStatus { + pub fn as_str(self) -> &'static str { + match self { + BillingMeterEventAdjustmentStatus::Complete => "complete", + BillingMeterEventAdjustmentStatus::Pending => "pending", + } + } +} + +impl AsRef for BillingMeterEventAdjustmentStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingMeterEventAdjustmentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingMeterEventAdjustmentStatus { + fn default() -> Self { + Self::Complete + } +} + +/// An enum representing the possible values of an `BillingMeterEventAdjustment`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BillingMeterEventAdjustmentType { + Cancel, +} + +impl BillingMeterEventAdjustmentType { + pub fn as_str(self) -> &'static str { + match self { + BillingMeterEventAdjustmentType::Cancel => "cancel", + } + } +} + +impl AsRef for BillingMeterEventAdjustmentType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BillingMeterEventAdjustmentType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BillingMeterEventAdjustmentType { + fn default() -> Self { + Self::Cancel + } +} diff --git a/src/resources/generated/billing_meter_event_summary.rs b/src/resources/generated/billing_meter_event_summary.rs new file mode 100644 index 000000000..482dc1da4 --- /dev/null +++ b/src/resources/generated/billing_meter_event_summary.rs @@ -0,0 +1,47 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{BillingMeterEventSummaryId}; +use crate::params::{Object, Timestamp}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "BillingMeterEventSummary". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingMeterEventSummary { + /// Unique identifier for the object. + pub id: BillingMeterEventSummaryId, + + /// Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). + /// + /// The aggregation strategy is defined on meter via `default_aggregation`. + pub aggregated_value: f64, + + /// End timestamp for this event summary (exclusive). + /// + /// Must be aligned with minute boundaries. + pub end_time: 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 meter associated with this event summary. + pub meter: String, + + /// Start timestamp for this event summary (inclusive). + /// + /// Must be aligned with minute boundaries. + pub start_time: Timestamp, +} + +impl Object for BillingMeterEventSummary { + type Id = BillingMeterEventSummaryId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "billing.meter_event_summary" + } +} diff --git a/src/resources/generated/billing_portal_configuration.rs b/src/resources/generated/billing_portal_configuration.rs index 6a27997c3..599af0eb9 100644 --- a/src/resources/generated/billing_portal_configuration.rs +++ b/src/resources/generated/billing_portal_configuration.rs @@ -87,8 +87,6 @@ pub struct PortalFeatures { pub subscription_cancel: PortalSubscriptionCancel, - pub subscription_pause: PortalSubscriptionPause, - pub subscription_update: PortalSubscriptionUpdate, } @@ -153,12 +151,6 @@ pub struct PortalSubscriptionCancellationReason { 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. @@ -170,11 +162,13 @@ pub struct PortalSubscriptionUpdate { pub enabled: bool, /// The list of up to 10 products that support subscription updates. + #[serde(skip_serializing_if = "Option::is_none")] pub products: Option>, /// Determines how to handle prorations resulting from subscription updates. /// /// Valid values are `none`, `create_prorations`, and `always_invoice`. + /// Defaults to a value of `none` if you don't set it during creation. pub proration_behavior: PortalSubscriptionUpdateProrationBehavior, } diff --git a/src/resources/generated/billing_portal_session.rs b/src/resources/generated/billing_portal_session.rs index 70ea41ebe..a20fc2974 100644 --- a/src/resources/generated/billing_portal_session.rs +++ b/src/resources/generated/billing_portal_session.rs @@ -42,7 +42,7 @@ pub struct BillingPortalSession { /// 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). + /// For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). /// 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, @@ -219,7 +219,7 @@ pub struct CreateBillingPortalSession<'a> { /// 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). + /// For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). /// 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>, diff --git a/src/resources/generated/capability.rs b/src/resources/generated/capability.rs index c3b906ebb..85261006d 100644 --- a/src/resources/generated/capability.rs +++ b/src/resources/generated/capability.rs @@ -33,8 +33,6 @@ pub struct Capability { pub requirements: Option, /// The status of the capability. - /// - /// Can be `active`, `inactive`, `pending`, or `unrequested`. pub status: CapabilityStatus, } @@ -64,8 +62,8 @@ pub struct AccountCapabilityFutureRequirements { /// 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, + /// This is typed as an enum for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is null 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, @@ -81,10 +79,11 @@ pub struct AccountCapabilityFutureRequirements { /// 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. + /// Fields that might become required depending on the results of verification or review. /// - /// Will be an empty array unless an asynchronous verification is pending. + /// It's an empty array unless an asynchronous verification is pending. /// If verification fails, these fields move to `eventually_due` or `currently_due`. + /// Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. pub pending_verification: Vec, } @@ -104,11 +103,10 @@ pub struct AccountCapabilityRequirements { /// 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. + /// Description of why the capability is disabled. /// - /// 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, + /// [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). + pub disabled_reason: Option, /// Fields that are `currently_due` and need to be collected again because validation or verification failed. pub errors: Vec, @@ -123,10 +121,11 @@ pub struct AccountCapabilityRequirements { /// 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. + /// Fields that might become required depending on the results of verification or review. /// - /// Will be an empty array unless an asynchronous verification is pending. + /// It's an empty array unless an asynchronous verification is pending. /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + /// Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. pub pending_verification: Vec, } @@ -153,6 +152,120 @@ pub struct AccountRequirementsError { pub requirement: String, } +/// An enum representing the possible values of an `AccountCapabilityFutureRequirements`'s `disabled_reason` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilityFutureRequirementsDisabledReason { + Other, + #[serde(rename = "paused.inactivity")] + PausedInactivity, + #[serde(rename = "pending.onboarding")] + PendingOnboarding, + #[serde(rename = "pending.review")] + PendingReview, + PlatformDisabled, + PlatformPaused, + #[serde(rename = "rejected.inactivity")] + RejectedInactivity, + #[serde(rename = "rejected.other")] + RejectedOther, + #[serde(rename = "rejected.unsupported_business")] + RejectedUnsupportedBusiness, + #[serde(rename = "requirements.fields_needed")] + RequirementsFieldsNeeded, +} + +impl AccountCapabilityFutureRequirementsDisabledReason { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilityFutureRequirementsDisabledReason::Other => "other", + AccountCapabilityFutureRequirementsDisabledReason::PausedInactivity => "paused.inactivity", + AccountCapabilityFutureRequirementsDisabledReason::PendingOnboarding => "pending.onboarding", + AccountCapabilityFutureRequirementsDisabledReason::PendingReview => "pending.review", + AccountCapabilityFutureRequirementsDisabledReason::PlatformDisabled => "platform_disabled", + AccountCapabilityFutureRequirementsDisabledReason::PlatformPaused => "platform_paused", + AccountCapabilityFutureRequirementsDisabledReason::RejectedInactivity => "rejected.inactivity", + AccountCapabilityFutureRequirementsDisabledReason::RejectedOther => "rejected.other", + AccountCapabilityFutureRequirementsDisabledReason::RejectedUnsupportedBusiness => "rejected.unsupported_business", + AccountCapabilityFutureRequirementsDisabledReason::RequirementsFieldsNeeded => "requirements.fields_needed", + } + } +} + +impl AsRef for AccountCapabilityFutureRequirementsDisabledReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilityFutureRequirementsDisabledReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilityFutureRequirementsDisabledReason { + fn default() -> Self { + Self::Other + } +} + +/// An enum representing the possible values of an `AccountCapabilityRequirements`'s `disabled_reason` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilityRequirementsDisabledReason { + Other, + #[serde(rename = "paused.inactivity")] + PausedInactivity, + #[serde(rename = "pending.onboarding")] + PendingOnboarding, + #[serde(rename = "pending.review")] + PendingReview, + PlatformDisabled, + PlatformPaused, + #[serde(rename = "rejected.inactivity")] + RejectedInactivity, + #[serde(rename = "rejected.other")] + RejectedOther, + #[serde(rename = "rejected.unsupported_business")] + RejectedUnsupportedBusiness, + #[serde(rename = "requirements.fields_needed")] + RequirementsFieldsNeeded, +} + +impl AccountCapabilityRequirementsDisabledReason { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilityRequirementsDisabledReason::Other => "other", + AccountCapabilityRequirementsDisabledReason::PausedInactivity => "paused.inactivity", + AccountCapabilityRequirementsDisabledReason::PendingOnboarding => "pending.onboarding", + AccountCapabilityRequirementsDisabledReason::PendingReview => "pending.review", + AccountCapabilityRequirementsDisabledReason::PlatformDisabled => "platform_disabled", + AccountCapabilityRequirementsDisabledReason::PlatformPaused => "platform_paused", + AccountCapabilityRequirementsDisabledReason::RejectedInactivity => "rejected.inactivity", + AccountCapabilityRequirementsDisabledReason::RejectedOther => "rejected.other", + AccountCapabilityRequirementsDisabledReason::RejectedUnsupportedBusiness => "rejected.unsupported_business", + AccountCapabilityRequirementsDisabledReason::RequirementsFieldsNeeded => "requirements.fields_needed", + } + } +} + +impl AsRef for AccountCapabilityRequirementsDisabledReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilityRequirementsDisabledReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilityRequirementsDisabledReason { + fn default() -> Self { + Self::Other + } +} + /// 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")] @@ -238,6 +351,7 @@ pub enum AccountRequirementsErrorCode { VerificationFailedKeyedMatch, VerificationFailedNameMatch, VerificationFailedOther, + VerificationFailedRepresentativeAuthority, VerificationFailedResidentialAddress, VerificationFailedTaxIdMatch, VerificationFailedTaxIdNotIssued, @@ -245,6 +359,8 @@ pub enum AccountRequirementsErrorCode { VerificationMissingExecutives, VerificationMissingOwners, VerificationRequiresAdditionalMemorandumOfAssociations, + VerificationRequiresAdditionalProofOfRegistration, + VerificationSupportability, } impl AccountRequirementsErrorCode { @@ -330,6 +446,7 @@ impl AccountRequirementsErrorCode { AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", + AccountRequirementsErrorCode::VerificationFailedRepresentativeAuthority => "verification_failed_representative_authority", AccountRequirementsErrorCode::VerificationFailedResidentialAddress => "verification_failed_residential_address", AccountRequirementsErrorCode::VerificationFailedTaxIdMatch => "verification_failed_tax_id_match", AccountRequirementsErrorCode::VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued", @@ -337,6 +454,8 @@ impl AccountRequirementsErrorCode { AccountRequirementsErrorCode::VerificationMissingExecutives => "verification_missing_executives", AccountRequirementsErrorCode::VerificationMissingOwners => "verification_missing_owners", AccountRequirementsErrorCode::VerificationRequiresAdditionalMemorandumOfAssociations => "verification_requires_additional_memorandum_of_associations", + AccountRequirementsErrorCode::VerificationRequiresAdditionalProofOfRegistration => "verification_requires_additional_proof_of_registration", + AccountRequirementsErrorCode::VerificationSupportability => "verification_supportability", } } } diff --git a/src/resources/generated/card.rs b/src/resources/generated/card.rs index 458001f38..351f082d8 100644 --- a/src/resources/generated/card.rs +++ b/src/resources/generated/card.rs @@ -19,6 +19,7 @@ pub struct Card { /// 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. + /// This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub account: Option>, @@ -62,7 +63,7 @@ pub struct Card { /// Card brand. /// - /// Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. + /// Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. #[serde(skip_serializing_if = "Option::is_none")] pub brand: Option, @@ -72,10 +73,12 @@ pub struct Card { #[serde(skip_serializing_if = "Option::is_none")] pub country: Option, - /// Three-letter [ISO code for currency](https://stripe.com/docs/payouts). + /// Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. /// + /// Must be a [supported currency](https://docs.stripe.com/currencies). /// Only applicable on accounts (not customers or recipients). /// The card can be used as a transfer destination for funds in this currency. + /// This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub currency: Option, @@ -94,6 +97,8 @@ pub struct Card { pub cvc_check: Option, /// Whether this card is the default external account for its currency. + /// + /// This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub default_for_currency: Option, @@ -158,6 +163,9 @@ pub struct Card { #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: 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. @@ -181,6 +189,14 @@ impl Object for Card { } } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TokenCardNetworks { + /// 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, +} + /// 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")] diff --git a/src/resources/generated/charge.rs b/src/resources/generated/charge.rs index 6ec262e75..5c7e7c749 100644 --- a/src/resources/generated/charge.rs +++ b/src/resources/generated/charge.rs @@ -10,9 +10,9 @@ use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Range 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, + PaymentMethodDetailsCardInstallmentsPlan, PaymentMethodDetailsCardPresent, + PaymentMethodDetailsCardWalletApplePay, PaymentMethodDetailsCardWalletGooglePay, PaymentSource, + RadarRadarOptions, Refund, Review, Shipping, Transfer, }; /// The resource representing a Stripe "Charge". @@ -41,12 +41,12 @@ pub struct Charge { /// The application fee (if any) for the charge. /// - /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details. + /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collect-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. + /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collect-fees) for details. pub application_fee_amount: Option, /// Authorization code on the charge. @@ -61,6 +61,7 @@ pub struct Charge { /// 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. + /// This value only exists for card payments. 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. @@ -158,6 +159,7 @@ pub struct Charge { pub refunded: bool, /// A list of refunds that have been applied to the charge. + #[serde(skip_serializing_if = "Option::is_none")] pub refunds: Option>, /// ID of the review associated with this charge if one exists. @@ -175,19 +177,19 @@ pub struct Charge { /// 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. + /// [See the Connect documentation](https://docs.stripe.com/connect/destination-charges) for details. pub source_transfer: Option>, - /// For card charges, use `statement_descriptor_suffix` instead. + /// For a non-card charge, text that appears on the customer's statement as the statement descriptor. /// - /// 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. + /// This value overrides the account's default statement descriptor. + /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. pub statement_descriptor: Option, - /// Provides information about the charge that customers see on their statements. + /// Provides information about a card charge. /// - /// 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. + /// Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + /// If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. pub statement_descriptor_suffix: Option, /// The status of the payment is either `succeeded`, `pending`, or `failed`. @@ -378,6 +380,9 @@ pub struct PaymentMethodDetails { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub au_becs_debit: Option, @@ -432,6 +437,9 @@ pub struct PaymentMethodDetails { #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub multibanco: Option, @@ -471,6 +479,9 @@ pub struct PaymentMethodDetails { #[serde(skip_serializing_if = "Option::is_none")] pub swish: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: 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. @@ -572,7 +583,10 @@ pub struct PaymentMethodDetailsAcssDebit { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAffirm {} +pub struct PaymentMethodDetailsAffirm { + /// The Affirm transaction ID associated with this payment. + pub transaction_id: Option, +} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodDetailsAfterpayClearpay { @@ -583,6 +597,9 @@ pub struct PaymentMethodDetailsAfterpayClearpay { pub reference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodDetailsAmazonPay {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodDetailsAuBecsDebit { /// Bank-State-Branch number of the bank account. @@ -652,7 +669,10 @@ pub struct PaymentMethodDetailsBancontact { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsBlik {} +pub struct PaymentMethodDetailsBlik { + /// A unique and immutable identifier assigned by BLIK to every buyer. + pub buyer_id: Option, +} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodDetailsBoleto { @@ -666,6 +686,9 @@ pub struct PaymentMethodDetailsCard { /// The authorized amount. pub amount_authorized: Option, + /// Authorization code on the charge. + pub authorization_code: Option, + /// Card brand. /// /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. @@ -816,144 +839,6 @@ pub struct PaymentMethodDetailsCardNetworkToken { 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")] @@ -1213,6 +1098,13 @@ pub struct PaymentMethodDetailsInteracPresent { /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. pub network: Option, + /// This is used by the financial networks to identify a transaction. + /// + /// Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. + /// The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). + /// This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + pub network_transaction_id: Option, + /// EMV tag 5F2D. /// /// Preferred languages specified by the integrated circuit chip. @@ -1247,7 +1139,9 @@ pub struct PaymentMethodDetailsInteracPresentReceipt { /// A code returned by the card issuer. pub authorization_response_code: Option, - /// How the cardholder verified ownership of the card. + /// Describes the method used by the cardholder to verify ownership of the card. + /// + /// One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. pub cardholder_verification_method: Option, /// EMV tag 84. @@ -1264,15 +1158,30 @@ pub struct PaymentMethodDetailsInteracPresentReceipt { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodDetailsKlarna { + /// The payer details for this transaction. + pub payer_details: Option, + /// 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`. + /// 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`, `ro-RO`, `en-RO`, `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 KlarnaPayerDetails { + /// The payer's address. + pub address: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct KlarnaAddress { + /// The payer address country. + pub country: 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. @@ -1292,6 +1201,30 @@ pub struct PaymentMethodDetailsLink { pub country: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodDetailsMobilepay { + /// Internal card details. + pub card: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct InternalCard { + /// Brand of the card used in the transaction. + pub brand: Option, + + /// Two-letter ISO code representing the country of the card. + pub country: Option, + + /// Two digit number representing the card's expiration month. + pub exp_month: Option, + + /// Two digit number representing the card's expiration year. + pub exp_year: Option, + + /// The last 4 digits of the card. + pub last4: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodDetailsMultibanco { /// Entity number associated with this Multibanco payment. @@ -1460,6 +1393,9 @@ pub struct PaymentMethodDetailsSwish { pub verified_phone_last4: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodDetailsTwint {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodDetailsUsBankAccount { /// Account holder type: individual or company. @@ -1481,6 +1417,13 @@ pub struct PaymentMethodDetailsUsBankAccount { /// 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>, + + /// Reference number to locate ACH payments with customer's bank. + pub payment_reference: Option, + /// Routing number of the bank account. pub routing_number: Option, } @@ -1575,7 +1518,7 @@ pub struct CreateCharge<'a> { /// 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). + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collect-fees). #[serde(skip_serializing_if = "Option::is_none")] pub application_fee_amount: Option, @@ -1623,7 +1566,7 @@ pub struct CreateCharge<'a> { /// 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). + /// For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). #[serde(skip_serializing_if = "Option::is_none")] pub on_behalf_of: Option<&'a str>, @@ -1654,17 +1597,17 @@ pub struct CreateCharge<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub source: Option, - /// For card charges, use `statement_descriptor_suffix` instead. + /// For a non-card charge, text that appears on the customer's statement as the statement descriptor. /// - /// 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. + /// This value overrides the account's default statement descriptor. + /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor: Option<&'a str>, - /// Provides information about the charge that customers see on their statements. + /// Provides information about a card charge. /// - /// 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. + /// Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + /// If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor_suffix: Option<&'a str>, @@ -1710,6 +1653,7 @@ impl<'a> CreateCharge<'a> { /// The parameters for `Charge::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListCharges<'a> { + /// Only return charges that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, @@ -1745,7 +1689,7 @@ pub struct ListCharges<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub starting_after: Option, - /// Only return charges for this transfer group. + /// Only return charges for this transfer group, limited to 100. #[serde(skip_serializing_if = "Option::is_none")] pub transfer_group: Option<&'a str>, } @@ -2151,90 +2095,6 @@ impl std::default::Default for PaymentMethodDetailsBancontactPreferredLanguage { } } -/// 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")] diff --git a/src/resources/generated/checkout_session.rs b/src/resources/generated/checkout_session.rs index 30545ffda..937b0d513 100644 --- a/src/resources/generated/checkout_session.rs +++ b/src/resources/generated/checkout_session.rs @@ -43,6 +43,8 @@ pub struct CheckoutSession { pub automatic_tax: PaymentPagesCheckoutSessionAutomaticTax, /// Describes whether Checkout should collect the customer's billing address. + /// + /// Defaults to `auto`. 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. @@ -72,7 +74,7 @@ pub struct CheckoutSession { /// Must be a [supported currency](https://stripe.com/docs/currencies). pub currency: Option, - /// Currency conversion details for automatic currency conversion sessions. + /// Currency conversion details for [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing) sessions. pub currency_conversion: Option, /// Collect additional information from your customer using custom fields. @@ -94,7 +96,7 @@ pub struct CheckoutSession { /// 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. + /// Customer's address details are not present on Sessions in `setup` mode. pub customer_details: Option, /// If provided, this value will be used when the Customer object is created. @@ -135,12 +137,17 @@ pub struct CheckoutSession { pub mode: CheckoutSessionMode, /// The ID of the PaymentIntent for Checkout Sessions in `payment` mode. + /// + /// You can't confirm or cancel the PaymentIntent for a Checkout Session. + /// To cancel, [expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. 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. + /// + /// Defaults to `always`. pub payment_method_collection: Option, /// Information about the payment method configuration used for this Checkout session if using dynamic payment methods. @@ -165,10 +172,10 @@ pub struct CheckoutSession { /// 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`. + /// 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. + /// Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. + /// Defaults to `always`. #[serde(skip_serializing_if = "Option::is_none")] pub redirect_on_completion: Option, @@ -178,7 +185,15 @@ pub struct CheckoutSession { #[serde(skip_serializing_if = "Option::is_none")] pub return_url: Option, + /// Controls saved payment method settings for the session. + /// + /// Only available in `payment` and `subscription` mode. + pub saved_payment_method_options: Option, + /// The ID of the SetupIntent for Checkout Sessions in `setup` mode. + /// + /// You can't confirm or cancel the SetupIntent for a Checkout Session. + /// To cancel, [expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. pub setup_intent: Option>, /// When set, provides configuration for Checkout to collect a shipping address from a customer. @@ -218,7 +233,7 @@ pub struct CheckoutSession { /// The UI mode of the Session. /// - /// Can be `hosted` (default) or `embedded`. + /// Defaults to `hosted`. pub ui_mode: Option, /// The URL to the Checkout Session. @@ -243,6 +258,16 @@ impl CheckoutSession { #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/checkout/sessions", ¶ms) } + + /// Updates a Session object. + pub fn update( + client: &Client, + id: &CheckoutSessionId, + params: UpdateCheckoutSession<'_>, + ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] + client.post_form(&format!("/checkout/{}", id), ¶ms) + } } impl Object for CheckoutSession { @@ -269,6 +294,9 @@ pub struct CheckoutSessionPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub au_becs_debit: Option, @@ -314,6 +342,12 @@ pub struct CheckoutSessionPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub oxxo: Option, @@ -358,9 +392,9 @@ pub struct CheckoutAcssDebitPaymentMethodOptions { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -397,9 +431,9 @@ pub struct CheckoutAcssDebitMandateOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -408,9 +442,9 @@ pub struct CheckoutAffirmPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -419,20 +453,31 @@ pub struct CheckoutAfterpayClearpayPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CheckoutAmazonPayPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -441,9 +486,9 @@ pub struct CheckoutAuBecsDebitPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -452,9 +497,9 @@ pub struct CheckoutBacsDebitPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -468,9 +513,9 @@ pub struct CheckoutBoletoPaymentMethodOptions { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -480,11 +525,18 @@ pub struct CheckoutCardPaymentMethodOptions { #[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. + /// If not provided, this value defaults to `automatic`. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + pub request_three_d_secure: CheckoutCardPaymentMethodOptionsRequestThreeDSecure, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -516,9 +568,9 @@ pub struct CheckoutCardInstallmentsOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -535,9 +587,9 @@ pub struct CheckoutCustomerBalancePaymentMethodOptions { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -563,9 +615,9 @@ pub struct CheckoutCustomerBalanceBankTransferPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -574,9 +626,9 @@ pub struct CheckoutEpsPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -585,9 +637,9 @@ pub struct CheckoutFpxPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -596,9 +648,9 @@ pub struct CheckoutGiropayPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -607,9 +659,9 @@ pub struct CheckoutGrabPayPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -618,9 +670,9 @@ pub struct CheckoutIdealPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -634,9 +686,9 @@ pub struct CheckoutKonbiniPaymentMethodOptions { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -645,13 +697,35 @@ pub struct CheckoutKonbiniPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CheckoutMobilepayPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CheckoutMultibancoPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/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. @@ -661,9 +735,9 @@ pub struct CheckoutOxxoPaymentMethodOptions { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -672,9 +746,9 @@ pub struct CheckoutOxxoPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -683,9 +757,9 @@ pub struct CheckoutP24PaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -706,9 +780,9 @@ pub struct CheckoutPaypalPaymentMethodOptions { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -720,15 +794,23 @@ pub struct CheckoutPixPaymentMethodOptions { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutRevolutPayPaymentMethodOptions {} +pub struct CheckoutRevolutPayPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} #[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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -737,9 +819,9 @@ pub struct CheckoutSepaDebitPaymentMethodOptions { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -759,9 +841,9 @@ pub struct CheckoutUsBankAccountPaymentMethodOptions { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -882,6 +964,9 @@ pub struct PaymentPagesCheckoutSessionCustomFields { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentPagesCheckoutSessionCustomFieldsDropdown { + /// The value that will pre-fill on the payment page. + pub default_value: Option, + /// The options available for the customer to select. /// /// Up to 200 options allowed. @@ -907,6 +992,9 @@ pub struct PaymentPagesCheckoutSessionCustomFieldsLabel { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentPagesCheckoutSessionCustomFieldsNumeric { + /// The value that will pre-fill the field on the payment page. + pub default_value: Option, + /// The maximum character length constraint for the customer's input. pub maximum_length: Option, @@ -932,6 +1020,9 @@ pub struct PaymentPagesCheckoutSessionCustomFieldsOption { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentPagesCheckoutSessionCustomFieldsText { + /// The value that will pre-fill the field on the payment page. + pub default_value: Option, + /// The maximum character length constraint for the customer's input. pub maximum_length: Option, @@ -1050,6 +1141,27 @@ pub struct PaymentPagesCheckoutSessionPhoneNumberCollection { pub enabled: bool, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentPagesCheckoutSessionSavedPaymentMethodOptions { + /// Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. + /// + /// By default, only saved payment methods with ’allow_redisplay: ‘always’ are shown in Checkout. + pub allow_redisplay_filters: + Option>, + + /// Enable customers to choose if they wish to remove their saved payment methods. + /// + /// Disabled by default. + pub payment_method_remove: + Option, + + /// Enable customers to choose if they wish to save their payment method for future use. + /// + /// Disabled by default. + pub payment_method_save: + Option, +} + #[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 @@ -1108,7 +1220,7 @@ pub struct PaymentPagesCheckoutSessionShippingOption { #[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`. + /// 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`, `hr_oib`, `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`, `no_voec`, `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`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown`. #[serde(rename = "type")] pub type_: PaymentPagesCheckoutSessionTaxIdType, @@ -1120,6 +1232,9 @@ pub struct PaymentPagesCheckoutSessionTaxId { pub struct PaymentPagesCheckoutSessionTaxIdCollection { /// Indicates whether tax ID collection is enabled for the session. pub enabled: bool, + + /// Indicates whether a tax ID is required on the payment page. + pub required: PaymentPagesCheckoutSessionTaxIdCollectionRequired, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1170,10 +1285,14 @@ pub struct CreateCheckoutSession<'a> { pub automatic_tax: Option, /// Specify whether Checkout should collect the customer's billing address. + /// + /// Defaults to `auto`. #[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. + /// + /// This parameter is not allowed if ui_mode is `embedded`. #[serde(skip_serializing_if = "Option::is_none")] pub cancel_url: Option<&'a str>, @@ -1293,7 +1412,8 @@ pub struct CreateCheckoutSession<'a> { /// 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). + /// 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. + /// Defaults to `always`. 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, @@ -1301,6 +1421,10 @@ pub struct CreateCheckoutSession<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub payment_method_configuration: Option, + /// This parameter allows you to set some attributes on the payment method created during a Checkout session. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option, + /// Payment-method-specific configuration. #[serde(skip_serializing_if = "Option::is_none")] pub payment_method_options: Option, @@ -1330,8 +1454,8 @@ pub struct CreateCheckoutSession<'a> { /// 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. + /// Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. + /// Defaults to `always`. #[serde(skip_serializing_if = "Option::is_none")] pub redirect_on_completion: Option, @@ -1342,6 +1466,12 @@ pub struct CreateCheckoutSession<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub return_url: Option<&'a str>, + /// Controls saved payment method settings for the session. + /// + /// Only available in `payment` and `subscription` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub saved_payment_method_options: Option, + /// 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, @@ -1376,13 +1506,13 @@ pub struct CreateCheckoutSession<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub success_url: Option<&'a str>, - /// Controls tax ID collection settings for the session. + /// Controls tax ID collection during checkout. #[serde(skip_serializing_if = "Option::is_none")] pub tax_id_collection: Option, - /// `ui_mode` can be `hosted` or `embedded`. + /// The UI mode of the Session. /// - /// The default is `hosted`. + /// Defaults to `hosted`. #[serde(skip_serializing_if = "Option::is_none")] pub ui_mode: Option, } @@ -1415,11 +1545,13 @@ impl<'a> CreateCheckoutSession<'a> { payment_intent_data: Default::default(), payment_method_collection: Default::default(), payment_method_configuration: Default::default(), + payment_method_data: 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(), + saved_payment_method_options: Default::default(), setup_intent_data: Default::default(), shipping_address_collection: Default::default(), shipping_options: Default::default(), @@ -1435,7 +1567,7 @@ impl<'a> CreateCheckoutSession<'a> { /// 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. + /// Only return Checkout Sessions that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, @@ -1511,6 +1643,28 @@ impl Paginable for ListCheckoutSessions<'_> { self.starting_after = Some(item.id()); } } +/// The parameters for `CheckoutSession::update`. +#[derive(Clone, Debug, Serialize, Default)] +pub struct UpdateCheckoutSession<'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> UpdateCheckoutSession<'a> { + pub fn new() -> Self { + UpdateCheckoutSession { expand: Default::default(), metadata: Default::default() } + } +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionAfterExpiration { /// Configure a Checkout Session that can be used to recover an expired session. @@ -1748,16 +1902,17 @@ pub struct CreateCheckoutSessionPaymentIntentData { #[serde(skip_serializing_if = "Option::is_none")] pub shipping: Option, - /// Extra information about the payment. + /// Text that appears on the customer's statement as the statement descriptor for a non-card charge. /// - /// This will appear on your customer's statement when this payment succeeds in creating a charge. + /// This value overrides the account's default statement descriptor. + /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). Setting this value for a card charge returns an error. + /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor: Option, - /// Provides information about the charge that customers see on their statements. + /// Provides information about a card charge. /// - /// 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. + /// Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor_suffix: Option, @@ -1773,6 +1928,15 @@ pub struct CreateCheckoutSessionPaymentIntentData { pub transfer_group: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCheckoutSessionPaymentMethodData { + /// Allow redisplay will be set on the payment method on confirmation and indicates whether this payment method can be shown again to the customer in a checkout flow. + /// + /// Only set this field if you wish to override the allow_redisplay value determined by Checkout. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redisplay: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionPaymentMethodOptions { /// contains details about the ACSS Debit payment method options. @@ -1791,6 +1955,10 @@ pub struct CreateCheckoutSessionPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + /// contains details about the AmazonPay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + /// contains details about the AU Becs Debit payment method options. #[serde(skip_serializing_if = "Option::is_none")] pub au_becs_debit: Option, @@ -1851,6 +2019,14 @@ pub struct CreateCheckoutSessionPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, + /// contains details about the Mobilepay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + + /// contains details about the Multibanco payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + /// contains details about the OXXO payment method options. #[serde(skip_serializing_if = "Option::is_none")] pub oxxo: Option, @@ -1902,6 +2078,23 @@ pub struct CreateCheckoutSessionPhoneNumberCollection { pub enabled: bool, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCheckoutSessionSavedPaymentMethodOptions { + /// Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. + /// + /// By default, only saved payment methods with ’allow_redisplay: ‘always’ are shown in Checkout. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redisplay_filters: + Option>, + + /// Enable customers to choose if they wish to save their payment method for future use. + /// + /// Disabled by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_save: + Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionSetupIntentData { /// An arbitrary string attached to the object. @@ -2017,8 +2210,16 @@ pub struct CreateCheckoutSessionSubscriptionData { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionTaxIdCollection { - /// Set to true to enable Tax ID collection. + /// Enable tax ID collection during checkout. + /// + /// Defaults to `false`. pub enabled: bool, + + /// Describes whether a tax ID is required during checkout. + /// + /// Defaults to `never`. + #[serde(skip_serializing_if = "Option::is_none")] + pub required: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -2064,6 +2265,10 @@ pub struct CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionCustomFieldsDropdown { + /// The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_value: Option, + /// The options available for the customer to select. /// /// Up to 200 options allowed. @@ -2084,6 +2289,10 @@ pub struct CreateCheckoutSessionCustomFieldsLabel { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionCustomFieldsNumeric { + /// The value that will pre-fill the field on the payment page. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_value: Option, + /// The maximum character length constraint for the customer's input. #[serde(skip_serializing_if = "Option::is_none")] pub maximum_length: Option, @@ -2095,6 +2304,10 @@ pub struct CreateCheckoutSessionCustomFieldsNumeric { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionCustomFieldsText { + /// The value that will pre-fill the field on the payment page. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_value: Option, + /// The maximum character length constraint for the customer's input. #[serde(skip_serializing_if = "Option::is_none")] pub maximum_length: Option, @@ -2170,8 +2383,6 @@ pub struct CreateCheckoutSessionInvoiceCreationInvoiceData { #[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. @@ -2284,9 +2495,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsAcssDebit { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2301,9 +2512,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsAcssDebit { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -2312,9 +2523,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsAffirm { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2324,20 +2535,32 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsAmazonPay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2347,9 +2570,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2359,9 +2582,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsBacsDebit { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2377,9 +2600,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsBoleto { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -2390,11 +2613,20 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsCard { #[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. + /// If not provided, this value defaults to `automatic`. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#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, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2419,9 +2651,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsCard { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2441,9 +2673,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalance { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2453,9 +2685,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalance { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -2464,9 +2696,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsEps { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -2475,9 +2707,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsFpx { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2487,9 +2719,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsGiropay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2499,9 +2731,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsGrabpay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -2510,9 +2742,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsIdeal { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -2528,9 +2760,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsKonbini { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2540,13 +2772,37 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsKonbini { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsMobilepay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsMultibanco { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/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. @@ -2557,9 +2813,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsOxxo { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -2568,9 +2824,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsOxxo { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2583,9 +2839,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsP24 { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -2612,9 +2868,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsPaypal { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -2632,9 +2888,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsPix { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2644,9 +2900,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsRevolutPay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2656,9 +2912,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsSepaDebit { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -2681,9 +2937,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsUsBankAccount { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2707,9 +2963,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsWechatPay { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2756,8 +3012,6 @@ pub struct CreateCheckoutSessionShippingOptionsShippingRateData { 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, @@ -2808,12 +3062,12 @@ pub struct CreateCheckoutSessionCustomFieldsDropdownOptions { pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields { /// The name of the custom field. /// - /// This may be up to 30 characters. + /// This may be up to 40 characters. pub name: String, /// The value of the custom field. /// - /// This may be up to 30 characters. + /// This may be up to 140 characters. pub value: String, } @@ -3353,6 +3607,40 @@ impl std::default::Default for CheckoutAlipayPaymentMethodOptionsSetupFutureUsag } } +/// An enum representing the possible values of an `CheckoutAmazonPayPaymentMethodOptions`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CheckoutAmazonPayPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, +} + +impl CheckoutAmazonPayPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CheckoutAmazonPayPaymentMethodOptionsSetupFutureUsage::None => "none", + CheckoutAmazonPayPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", + } + } +} + +impl AsRef for CheckoutAmazonPayPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CheckoutAmazonPayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CheckoutAmazonPayPaymentMethodOptionsSetupFutureUsage { + 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")] @@ -3489,6 +3777,42 @@ impl std::default::Default for CheckoutBoletoPaymentMethodOptionsSetupFutureUsag } } +/// An enum representing the possible values of an `CheckoutCardPaymentMethodOptions`'s `request_three_d_secure` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CheckoutCardPaymentMethodOptionsRequestThreeDSecure { + Any, + Automatic, + Challenge, +} + +impl CheckoutCardPaymentMethodOptionsRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + match self { + CheckoutCardPaymentMethodOptionsRequestThreeDSecure::Any => "any", + CheckoutCardPaymentMethodOptionsRequestThreeDSecure::Automatic => "automatic", + CheckoutCardPaymentMethodOptionsRequestThreeDSecure::Challenge => "challenge", + } + } +} + +impl AsRef for CheckoutCardPaymentMethodOptionsRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CheckoutCardPaymentMethodOptionsRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CheckoutCardPaymentMethodOptionsRequestThreeDSecure { + fn default() -> Self { + Self::Any + } +} + /// 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")] @@ -3981,6 +4305,70 @@ impl std::default::Default for CheckoutLinkPaymentMethodOptionsSetupFutureUsage } } +/// An enum representing the possible values of an `CheckoutMobilepayPaymentMethodOptions`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CheckoutMobilepayPaymentMethodOptionsSetupFutureUsage { + None, +} + +impl CheckoutMobilepayPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CheckoutMobilepayPaymentMethodOptionsSetupFutureUsage::None => "none", + } + } +} + +impl AsRef for CheckoutMobilepayPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CheckoutMobilepayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CheckoutMobilepayPaymentMethodOptionsSetupFutureUsage { + fn default() -> Self { + Self::None + } +} + +/// An enum representing the possible values of an `CheckoutMultibancoPaymentMethodOptions`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CheckoutMultibancoPaymentMethodOptionsSetupFutureUsage { + None, +} + +impl CheckoutMultibancoPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CheckoutMultibancoPaymentMethodOptionsSetupFutureUsage::None => "none", + } + } +} + +impl AsRef for CheckoutMultibancoPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CheckoutMultibancoPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CheckoutMultibancoPaymentMethodOptionsSetupFutureUsage { + 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")] @@ -4143,43 +4531,77 @@ impl std::default::Default for CheckoutPaypalPaymentMethodOptionsSetupFutureUsag } } -/// An enum representing the possible values of an `CheckoutSepaDebitPaymentMethodOptions`'s `setup_future_usage` field. +/// An enum representing the possible values of an `CheckoutRevolutPayPaymentMethodOptions`'s `setup_future_usage` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] -pub enum CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { +pub enum CheckoutRevolutPayPaymentMethodOptionsSetupFutureUsage { None, OffSession, - OnSession, } -impl CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { +impl CheckoutRevolutPayPaymentMethodOptionsSetupFutureUsage { pub fn as_str(self) -> &'static str { match self { - CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", + CheckoutRevolutPayPaymentMethodOptionsSetupFutureUsage::None => "none", + CheckoutRevolutPayPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", } } } -impl AsRef for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { +impl AsRef for CheckoutRevolutPayPaymentMethodOptionsSetupFutureUsage { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { +impl std::fmt::Display for CheckoutRevolutPayPaymentMethodOptionsSetupFutureUsage { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { self.as_str().fmt(f) } } -impl std::default::Default for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { +impl std::default::Default for CheckoutRevolutPayPaymentMethodOptionsSetupFutureUsage { fn default() -> Self { Self::None } } -/// An enum representing the possible values of an `CheckoutSession`'s `billing_address_collection` field. +/// 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 { @@ -5253,6 +5675,42 @@ impl std::default::Default for CreateCheckoutSessionPaymentIntentDataSetupFuture } } +/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodData`'s `allow_redisplay` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionPaymentMethodDataAllowRedisplay { + Always, + Limited, + Unspecified, +} + +impl CreateCheckoutSessionPaymentMethodDataAllowRedisplay { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionPaymentMethodDataAllowRedisplay::Always => "always", + CreateCheckoutSessionPaymentMethodDataAllowRedisplay::Limited => "limited", + CreateCheckoutSessionPaymentMethodDataAllowRedisplay::Unspecified => "unspecified", + } + } +} + +impl AsRef for CreateCheckoutSessionPaymentMethodDataAllowRedisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodDataAllowRedisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionPaymentMethodDataAllowRedisplay { + fn default() -> Self { + Self::Always + } +} + /// 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")] @@ -5559,6 +6017,42 @@ impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsAlipaySe } } +/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAmazonPay`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage { + None, + OffSession, +} + +impl CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage::None => "none", + CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage::OffSession => { + "off_session" + } + } + } +} + +impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage { + 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")] @@ -5705,6 +6199,46 @@ impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsBoletoSe } } +/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCard`'s `request_three_d_secure` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} + +impl CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", + CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure::Automatic => { + "automatic" + } + CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure::Challenge => { + "challenge" + } + } + } +} + +impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure { + fn default() -> Self { + Self::Any + } +} + /// 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")] @@ -6209,6 +6743,70 @@ impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsLinkSetu } } +/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsMobilepay`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage { + None, +} + +impl CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage::None => "none", + } + } +} + +impl AsRef for CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage { + fn default() -> Self { + Self::None + } +} + +/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsMultibanco`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage { + None, +} + +impl CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage::None => "none", + } + } +} + +impl AsRef for CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage { + 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")] @@ -6623,6 +7221,7 @@ impl std::default::Default #[serde(rename_all = "snake_case")] pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { Balances, + Ownership, Transactions, } @@ -6630,6 +7229,7 @@ impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsP pub fn as_str(self) -> &'static str { match self { CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", + CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Ownership => "ownership", CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", } } @@ -6818,6 +7418,7 @@ pub enum CreateCheckoutSessionPaymentMethodTypes { Affirm, AfterpayClearpay, Alipay, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -6834,6 +7435,8 @@ pub enum CreateCheckoutSessionPaymentMethodTypes { Klarna, Konbini, Link, + Mobilepay, + Multibanco, Oxxo, P24, Paynow, @@ -6844,6 +7447,7 @@ pub enum CreateCheckoutSessionPaymentMethodTypes { SepaDebit, Sofort, Swish, + Twint, UsBankAccount, WechatPay, Zip, @@ -6856,6 +7460,7 @@ impl CreateCheckoutSessionPaymentMethodTypes { CreateCheckoutSessionPaymentMethodTypes::Affirm => "affirm", CreateCheckoutSessionPaymentMethodTypes::AfterpayClearpay => "afterpay_clearpay", CreateCheckoutSessionPaymentMethodTypes::Alipay => "alipay", + CreateCheckoutSessionPaymentMethodTypes::AmazonPay => "amazon_pay", CreateCheckoutSessionPaymentMethodTypes::AuBecsDebit => "au_becs_debit", CreateCheckoutSessionPaymentMethodTypes::BacsDebit => "bacs_debit", CreateCheckoutSessionPaymentMethodTypes::Bancontact => "bancontact", @@ -6872,6 +7477,8 @@ impl CreateCheckoutSessionPaymentMethodTypes { CreateCheckoutSessionPaymentMethodTypes::Klarna => "klarna", CreateCheckoutSessionPaymentMethodTypes::Konbini => "konbini", CreateCheckoutSessionPaymentMethodTypes::Link => "link", + CreateCheckoutSessionPaymentMethodTypes::Mobilepay => "mobilepay", + CreateCheckoutSessionPaymentMethodTypes::Multibanco => "multibanco", CreateCheckoutSessionPaymentMethodTypes::Oxxo => "oxxo", CreateCheckoutSessionPaymentMethodTypes::P24 => "p24", CreateCheckoutSessionPaymentMethodTypes::Paynow => "paynow", @@ -6882,6 +7489,7 @@ impl CreateCheckoutSessionPaymentMethodTypes { CreateCheckoutSessionPaymentMethodTypes::SepaDebit => "sepa_debit", CreateCheckoutSessionPaymentMethodTypes::Sofort => "sofort", CreateCheckoutSessionPaymentMethodTypes::Swish => "swish", + CreateCheckoutSessionPaymentMethodTypes::Twint => "twint", CreateCheckoutSessionPaymentMethodTypes::UsBankAccount => "us_bank_account", CreateCheckoutSessionPaymentMethodTypes::WechatPay => "wechat_pay", CreateCheckoutSessionPaymentMethodTypes::Zip => "zip", @@ -6906,6 +7514,80 @@ impl std::default::Default for CreateCheckoutSessionPaymentMethodTypes { } } +/// An enum representing the possible values of an `CreateCheckoutSessionSavedPaymentMethodOptions`'s `allow_redisplay_filters` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters { + Always, + Limited, + Unspecified, +} + +impl CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters::Always => "always", + CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters::Limited => { + "limited" + } + CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters::Unspecified => { + "unspecified" + } + } + } +} + +impl AsRef for CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters { + fn default() -> Self { + Self::Always + } +} + +/// An enum representing the possible values of an `CreateCheckoutSessionSavedPaymentMethodOptions`'s `payment_method_save` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave { + Disabled, + Enabled, +} + +impl CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave::Disabled => "disabled", + CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave::Enabled => "enabled", + } + } +} + +impl AsRef for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave { + fn default() -> Self { + Self::Disabled + } +} + /// 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")] @@ -7968,6 +8650,40 @@ impl std::default::Default } } +/// An enum representing the possible values of an `CreateCheckoutSessionTaxIdCollection`'s `required` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionTaxIdCollectionRequired { + IfSupported, + Never, +} + +impl CreateCheckoutSessionTaxIdCollectionRequired { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionTaxIdCollectionRequired::IfSupported => "if_supported", + CreateCheckoutSessionTaxIdCollectionRequired::Never => "never", + } + } +} + +impl AsRef for CreateCheckoutSessionTaxIdCollectionRequired { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionTaxIdCollectionRequired { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionTaxIdCollectionRequired { + fn default() -> Self { + Self::IfSupported + } +} + /// 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")] @@ -8338,6 +9054,126 @@ impl std::default::Default for PaymentPagesCheckoutSessionPaymentMethodReuseAgre } } +/// An enum representing the possible values of an `PaymentPagesCheckoutSessionSavedPaymentMethodOptions`'s `allow_redisplay_filters` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentPagesCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters { + Always, + Limited, + Unspecified, +} + +impl PaymentPagesCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters { + pub fn as_str(self) -> &'static str { + match self { + PaymentPagesCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters::Always => "always", + PaymentPagesCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters::Limited => "limited", + PaymentPagesCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters::Unspecified => "unspecified", + } + } +} + +impl AsRef for PaymentPagesCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display + for PaymentPagesCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default + for PaymentPagesCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters +{ + fn default() -> Self { + Self::Always + } +} + +/// An enum representing the possible values of an `PaymentPagesCheckoutSessionSavedPaymentMethodOptions`'s `payment_method_remove` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove { + Disabled, + Enabled, +} + +impl PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove { + pub fn as_str(self) -> &'static str { + match self { + PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove::Disabled => { + "disabled" + } + PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove::Enabled => { + "enabled" + } + } + } +} + +impl AsRef for PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default + for PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove +{ + fn default() -> Self { + Self::Disabled + } +} + +/// An enum representing the possible values of an `PaymentPagesCheckoutSessionSavedPaymentMethodOptions`'s `payment_method_save` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave { + Disabled, + Enabled, +} + +impl PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave { + pub fn as_str(self) -> &'static str { + match self { + PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave::Disabled => { + "disabled" + } + PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave::Enabled => { + "enabled" + } + } + } +} + +impl AsRef for PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default + for PaymentPagesCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave +{ + fn default() -> Self { + Self::Disabled + } +} + /// 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")] @@ -9081,6 +9917,40 @@ impl std::default::Default } } +/// An enum representing the possible values of an `PaymentPagesCheckoutSessionTaxIdCollection`'s `required` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentPagesCheckoutSessionTaxIdCollectionRequired { + IfSupported, + Never, +} + +impl PaymentPagesCheckoutSessionTaxIdCollectionRequired { + pub fn as_str(self) -> &'static str { + match self { + PaymentPagesCheckoutSessionTaxIdCollectionRequired::IfSupported => "if_supported", + PaymentPagesCheckoutSessionTaxIdCollectionRequired::Never => "never", + } + } +} + +impl AsRef for PaymentPagesCheckoutSessionTaxIdCollectionRequired { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentPagesCheckoutSessionTaxIdCollectionRequired { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentPagesCheckoutSessionTaxIdCollectionRequired { + fn default() -> Self { + Self::IfSupported + } +} + /// 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")] @@ -9091,6 +9961,7 @@ pub enum PaymentPagesCheckoutSessionTaxIdType { AuAbn, AuArn, BgUic, + BhVat, BoTin, BrCnpj, BrCpf, @@ -9100,11 +9971,13 @@ pub enum PaymentPagesCheckoutSessionTaxIdType { CaPstMb, CaPstSk, CaQst, + ChUid, ChVat, ClTin, CnTin, CoNit, CrTin, + DeStn, DoRcn, EcRuc, EgTin, @@ -9114,6 +9987,7 @@ pub enum PaymentPagesCheckoutSessionTaxIdType { GbVat, GeVat, HkBr, + HrOib, HuTin, IdNpwp, IlVat, @@ -9124,13 +9998,17 @@ pub enum PaymentPagesCheckoutSessionTaxIdType { JpTrn, KePin, KrBrn, + KzBin, LiUid, MxRfc, MyFrp, MyItn, MySst, + NgTin, NoVat, + NoVoec, NzGst, + OmVat, PeRuc, PhTin, RoTin, @@ -9163,6 +10041,7 @@ impl PaymentPagesCheckoutSessionTaxIdType { PaymentPagesCheckoutSessionTaxIdType::AuAbn => "au_abn", PaymentPagesCheckoutSessionTaxIdType::AuArn => "au_arn", PaymentPagesCheckoutSessionTaxIdType::BgUic => "bg_uic", + PaymentPagesCheckoutSessionTaxIdType::BhVat => "bh_vat", PaymentPagesCheckoutSessionTaxIdType::BoTin => "bo_tin", PaymentPagesCheckoutSessionTaxIdType::BrCnpj => "br_cnpj", PaymentPagesCheckoutSessionTaxIdType::BrCpf => "br_cpf", @@ -9172,11 +10051,13 @@ impl PaymentPagesCheckoutSessionTaxIdType { PaymentPagesCheckoutSessionTaxIdType::CaPstMb => "ca_pst_mb", PaymentPagesCheckoutSessionTaxIdType::CaPstSk => "ca_pst_sk", PaymentPagesCheckoutSessionTaxIdType::CaQst => "ca_qst", + PaymentPagesCheckoutSessionTaxIdType::ChUid => "ch_uid", PaymentPagesCheckoutSessionTaxIdType::ChVat => "ch_vat", PaymentPagesCheckoutSessionTaxIdType::ClTin => "cl_tin", PaymentPagesCheckoutSessionTaxIdType::CnTin => "cn_tin", PaymentPagesCheckoutSessionTaxIdType::CoNit => "co_nit", PaymentPagesCheckoutSessionTaxIdType::CrTin => "cr_tin", + PaymentPagesCheckoutSessionTaxIdType::DeStn => "de_stn", PaymentPagesCheckoutSessionTaxIdType::DoRcn => "do_rcn", PaymentPagesCheckoutSessionTaxIdType::EcRuc => "ec_ruc", PaymentPagesCheckoutSessionTaxIdType::EgTin => "eg_tin", @@ -9186,6 +10067,7 @@ impl PaymentPagesCheckoutSessionTaxIdType { PaymentPagesCheckoutSessionTaxIdType::GbVat => "gb_vat", PaymentPagesCheckoutSessionTaxIdType::GeVat => "ge_vat", PaymentPagesCheckoutSessionTaxIdType::HkBr => "hk_br", + PaymentPagesCheckoutSessionTaxIdType::HrOib => "hr_oib", PaymentPagesCheckoutSessionTaxIdType::HuTin => "hu_tin", PaymentPagesCheckoutSessionTaxIdType::IdNpwp => "id_npwp", PaymentPagesCheckoutSessionTaxIdType::IlVat => "il_vat", @@ -9196,13 +10078,17 @@ impl PaymentPagesCheckoutSessionTaxIdType { PaymentPagesCheckoutSessionTaxIdType::JpTrn => "jp_trn", PaymentPagesCheckoutSessionTaxIdType::KePin => "ke_pin", PaymentPagesCheckoutSessionTaxIdType::KrBrn => "kr_brn", + PaymentPagesCheckoutSessionTaxIdType::KzBin => "kz_bin", PaymentPagesCheckoutSessionTaxIdType::LiUid => "li_uid", PaymentPagesCheckoutSessionTaxIdType::MxRfc => "mx_rfc", PaymentPagesCheckoutSessionTaxIdType::MyFrp => "my_frp", PaymentPagesCheckoutSessionTaxIdType::MyItn => "my_itn", PaymentPagesCheckoutSessionTaxIdType::MySst => "my_sst", + PaymentPagesCheckoutSessionTaxIdType::NgTin => "ng_tin", PaymentPagesCheckoutSessionTaxIdType::NoVat => "no_vat", + PaymentPagesCheckoutSessionTaxIdType::NoVoec => "no_voec", PaymentPagesCheckoutSessionTaxIdType::NzGst => "nz_gst", + PaymentPagesCheckoutSessionTaxIdType::OmVat => "om_vat", PaymentPagesCheckoutSessionTaxIdType::PeRuc => "pe_ruc", PaymentPagesCheckoutSessionTaxIdType::PhTin => "ph_tin", PaymentPagesCheckoutSessionTaxIdType::RoTin => "ro_tin", diff --git a/src/resources/generated/confirmation_token.rs b/src/resources/generated/confirmation_token.rs new file mode 100644 index 000000000..c9376b5eb --- /dev/null +++ b/src/resources/generated/confirmation_token.rs @@ -0,0 +1,452 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::client::{Client, Response}; +use crate::ids::{ConfirmationTokenId}; +use crate::params::{Expand, Expandable, Object, Timestamp}; +use crate::resources::{Address, BillingDetails, CardDetails, CardPresent, Customer, PaymentFlowsPrivatePaymentMethodsAlipay, PaymentMethodAcssDebit, PaymentMethodAffirm, PaymentMethodAfterpayClearpay, PaymentMethodAmazonPay, PaymentMethodAuBecsDebit, PaymentMethodBacsDebit, PaymentMethodBancontact, PaymentMethodBlik, PaymentMethodBoleto, PaymentMethodCashapp, PaymentMethodCustomerBalance, PaymentMethodEps, PaymentMethodFpx, PaymentMethodGiropay, PaymentMethodGrabpay, PaymentMethodIdeal, PaymentMethodInteracPresent, PaymentMethodKlarna, PaymentMethodKonbini, PaymentMethodLink, PaymentMethodMobilepay, PaymentMethodMultibanco, PaymentMethodOxxo, PaymentMethodP24, PaymentMethodPaynow, PaymentMethodPaypal, PaymentMethodPix, PaymentMethodPromptpay, PaymentMethodRevolutPay, PaymentMethodSepaDebit, PaymentMethodSofort, PaymentMethodSwish, PaymentMethodTwint, PaymentMethodUsBankAccount, PaymentMethodWechatPay, PaymentMethodZip}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "ConfirmationTokensResourceConfirmationToken". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConfirmationToken { + /// Unique identifier for the object. + pub id: ConfirmationTokenId, + + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: Timestamp, + + /// Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. + 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, + + /// Data used for generating a Mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_data: Option, + + /// ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + pub payment_intent: Option, + + /// Payment-method-specific configuration for this ConfirmationToken. + pub payment_method_options: Option, + + /// Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. + pub payment_method_preview: Option, + + /// Return URL used to confirm the Intent. + pub return_url: Option, + + /// Indicates that you intend to make future payments with this ConfirmationToken's payment method. + /// + /// The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + pub setup_future_usage: Option, + + /// ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + pub setup_intent: Option, + + /// Shipping information collected on this ConfirmationToken. + pub shipping: Option, + + /// Indicates whether the Stripe SDK is used to handle confirmation flow. + /// + /// Defaults to `true` on ConfirmationToken. + pub use_stripe_sdk: bool, +} + +impl ConfirmationToken { + + /// Retrieves an existing ConfirmationToken object. + pub fn retrieve(client: &Client, id: &ConfirmationTokenId, expand: &[&str]) -> Response { + client.get_query(&format!("/confirmation_tokens/{}", id), Expand { expand }) + } +} + +impl Object for ConfirmationToken { + type Id = ConfirmationTokenId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "confirmation_token" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConfirmationTokensResourceMandateData { + + pub customer_acceptance: ConfirmationTokensResourceMandateDataResourceCustomerAcceptance, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConfirmationTokensResourceMandateDataResourceCustomerAcceptance { + + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + pub online: Option, + + /// The type of customer acceptance information included with the Mandate. + #[serde(rename = "type")] + pub type_: String, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConfirmationTokensResourceMandateDataResourceCustomerAcceptanceResourceOnline { + + /// The IP address from which the Mandate was accepted by the customer. + pub ip_address: Option, + + /// The user agent of the browser from which the Mandate was accepted by the customer. + pub user_agent: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConfirmationTokensResourcePaymentMethodOptions { + + /// This hash contains the card payment method options. + pub card: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConfirmationTokensResourcePaymentMethodOptionsResourceCard { + + /// The `cvc_update` Token collected from the Payment Element. + pub cvc_token: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConfirmationTokensResourcePaymentMethodPreview { + + #[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, + + /// This field indicates whether this payment method can be shown again to its customer in a checkout flow. + /// + /// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + /// The field defaults to “unspecified”. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redisplay: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: 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, + + /// 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, + + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: 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_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 twint: 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_: ConfirmationTokensResourcePaymentMethodPreviewType, + + #[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 ConfirmationTokensResourceShipping { + + pub address: Address, + + /// Recipient name. + pub name: String, + + /// Recipient phone (including extension). + pub phone: Option, +} + +/// An enum representing the possible values of an `ConfirmationToken`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum ConfirmationTokenSetupFutureUsage { + OffSession, + OnSession, +} + +impl ConfirmationTokenSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + ConfirmationTokenSetupFutureUsage::OffSession => "off_session", + ConfirmationTokenSetupFutureUsage::OnSession => "on_session", + } + } +} + +impl AsRef for ConfirmationTokenSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for ConfirmationTokenSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for ConfirmationTokenSetupFutureUsage { + fn default() -> Self { + Self::OffSession + } +} + +/// An enum representing the possible values of an `ConfirmationTokensResourcePaymentMethodPreview`'s `allow_redisplay` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum ConfirmationTokensResourcePaymentMethodPreviewAllowRedisplay { + Always, + Limited, + Unspecified, +} + +impl ConfirmationTokensResourcePaymentMethodPreviewAllowRedisplay { + pub fn as_str(self) -> &'static str { + match self { + ConfirmationTokensResourcePaymentMethodPreviewAllowRedisplay::Always => "always", + ConfirmationTokensResourcePaymentMethodPreviewAllowRedisplay::Limited => "limited", + ConfirmationTokensResourcePaymentMethodPreviewAllowRedisplay::Unspecified => "unspecified", + } + } +} + +impl AsRef for ConfirmationTokensResourcePaymentMethodPreviewAllowRedisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for ConfirmationTokensResourcePaymentMethodPreviewAllowRedisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for ConfirmationTokensResourcePaymentMethodPreviewAllowRedisplay { + fn default() -> Self { + Self::Always + } +} + +/// An enum representing the possible values of an `ConfirmationTokensResourcePaymentMethodPreview`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum ConfirmationTokensResourcePaymentMethodPreviewType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AmazonPay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + CardPresent, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + InteracPresent, + Klarna, + Konbini, + Link, + Mobilepay, + Multibanco, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + Twint, + UsBankAccount, + WechatPay, + Zip, +} + +impl ConfirmationTokensResourcePaymentMethodPreviewType { + pub fn as_str(self) -> &'static str { + match self { + ConfirmationTokensResourcePaymentMethodPreviewType::AcssDebit => "acss_debit", + ConfirmationTokensResourcePaymentMethodPreviewType::Affirm => "affirm", + ConfirmationTokensResourcePaymentMethodPreviewType::AfterpayClearpay => "afterpay_clearpay", + ConfirmationTokensResourcePaymentMethodPreviewType::Alipay => "alipay", + ConfirmationTokensResourcePaymentMethodPreviewType::AmazonPay => "amazon_pay", + ConfirmationTokensResourcePaymentMethodPreviewType::AuBecsDebit => "au_becs_debit", + ConfirmationTokensResourcePaymentMethodPreviewType::BacsDebit => "bacs_debit", + ConfirmationTokensResourcePaymentMethodPreviewType::Bancontact => "bancontact", + ConfirmationTokensResourcePaymentMethodPreviewType::Blik => "blik", + ConfirmationTokensResourcePaymentMethodPreviewType::Boleto => "boleto", + ConfirmationTokensResourcePaymentMethodPreviewType::Card => "card", + ConfirmationTokensResourcePaymentMethodPreviewType::CardPresent => "card_present", + ConfirmationTokensResourcePaymentMethodPreviewType::Cashapp => "cashapp", + ConfirmationTokensResourcePaymentMethodPreviewType::CustomerBalance => "customer_balance", + ConfirmationTokensResourcePaymentMethodPreviewType::Eps => "eps", + ConfirmationTokensResourcePaymentMethodPreviewType::Fpx => "fpx", + ConfirmationTokensResourcePaymentMethodPreviewType::Giropay => "giropay", + ConfirmationTokensResourcePaymentMethodPreviewType::Grabpay => "grabpay", + ConfirmationTokensResourcePaymentMethodPreviewType::Ideal => "ideal", + ConfirmationTokensResourcePaymentMethodPreviewType::InteracPresent => "interac_present", + ConfirmationTokensResourcePaymentMethodPreviewType::Klarna => "klarna", + ConfirmationTokensResourcePaymentMethodPreviewType::Konbini => "konbini", + ConfirmationTokensResourcePaymentMethodPreviewType::Link => "link", + ConfirmationTokensResourcePaymentMethodPreviewType::Mobilepay => "mobilepay", + ConfirmationTokensResourcePaymentMethodPreviewType::Multibanco => "multibanco", + ConfirmationTokensResourcePaymentMethodPreviewType::Oxxo => "oxxo", + ConfirmationTokensResourcePaymentMethodPreviewType::P24 => "p24", + ConfirmationTokensResourcePaymentMethodPreviewType::Paynow => "paynow", + ConfirmationTokensResourcePaymentMethodPreviewType::Paypal => "paypal", + ConfirmationTokensResourcePaymentMethodPreviewType::Pix => "pix", + ConfirmationTokensResourcePaymentMethodPreviewType::Promptpay => "promptpay", + ConfirmationTokensResourcePaymentMethodPreviewType::RevolutPay => "revolut_pay", + ConfirmationTokensResourcePaymentMethodPreviewType::SepaDebit => "sepa_debit", + ConfirmationTokensResourcePaymentMethodPreviewType::Sofort => "sofort", + ConfirmationTokensResourcePaymentMethodPreviewType::Swish => "swish", + ConfirmationTokensResourcePaymentMethodPreviewType::Twint => "twint", + ConfirmationTokensResourcePaymentMethodPreviewType::UsBankAccount => "us_bank_account", + ConfirmationTokensResourcePaymentMethodPreviewType::WechatPay => "wechat_pay", + ConfirmationTokensResourcePaymentMethodPreviewType::Zip => "zip", + } + } +} + +impl AsRef for ConfirmationTokensResourcePaymentMethodPreviewType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for ConfirmationTokensResourcePaymentMethodPreviewType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for ConfirmationTokensResourcePaymentMethodPreviewType { + fn default() -> Self { + Self::AcssDebit + } +} diff --git a/src/resources/generated/credit_note.rs b/src/resources/generated/credit_note.rs index d59172bbe..3da544180 100644 --- a/src/resources/generated/credit_note.rs +++ b/src/resources/generated/credit_note.rs @@ -6,10 +6,10 @@ 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::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; use crate::resources::{ - CreditNoteLineItem, Currency, Customer, CustomerBalanceTransaction, Discount, Invoice, - InvoicesShippingCost, Refund, TaxRate, + BillingCreditBalanceTransaction, CreditNoteLineItem, Currency, Customer, + CustomerBalanceTransaction, Discount, Invoice, InvoicesResourceShippingCost, Refund, TaxRate, }; /// The resource representing a Stripe "CreditNote". @@ -80,6 +80,9 @@ pub struct CreditNote { /// The link to download the PDF of the credit note. pub pdf: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub pretax_credit_amounts: Option>, + /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. pub reason: Option, @@ -87,7 +90,7 @@ pub struct CreditNote { pub refund: Option>, /// The details of the cost of shipping, including the ShippingRate applied to the invoice. - pub shipping_cost: Option, + pub shipping_cost: Option, /// Status of this credit note, one of `issued` or `void`. /// @@ -183,6 +186,24 @@ pub struct CreditNoteTaxAmount { pub taxable_amount: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreditNotesPretaxCreditAmount { + /// The amount, in cents (or local equivalent), of the pretax credit amount. + pub amount: i64, + + /// The credit balance transaction that was applied to get this pretax credit amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_balance_transaction: Option>, + + /// The discount that was applied to get this pretax credit amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option>, + + /// Type of the pretax credit amount referenced. + #[serde(rename = "type")] + pub type_: CreditNotesPretaxCreditAmountType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct DiscountsResourceDiscountAmount { /// The amount, in cents (or local equivalent), of the discount. @@ -210,6 +231,10 @@ pub struct CreateCreditNote<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub effective_at: Option, + /// Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. + #[serde(skip_serializing_if = "Option::is_none")] + pub email_type: Option, + /// Specifies which fields in the response should be expanded. #[serde(skip_serializing_if = "Expand::is_empty")] pub expand: &'a [&'a str], @@ -262,6 +287,7 @@ impl<'a> CreateCreditNote<'a> { amount: Default::default(), credit_amount: Default::default(), effective_at: Default::default(), + email_type: Default::default(), expand: Default::default(), invoice, lines: Default::default(), @@ -279,6 +305,10 @@ impl<'a> CreateCreditNote<'a> { /// The parameters for `CreditNote::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListCreditNotes<'a> { + /// Only return credit notes that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option>, + /// Only return credit notes for the customer specified by this customer ID. #[serde(skip_serializing_if = "Option::is_none")] pub customer: Option, @@ -315,6 +345,7 @@ pub struct ListCreditNotes<'a> { impl<'a> ListCreditNotes<'a> { pub fn new() -> Self { ListCreditNotes { + created: Default::default(), customer: Default::default(), ending_before: Default::default(), expand: Default::default(), @@ -469,6 +500,40 @@ impl std::default::Default for CreateCreditNoteLinesType { } } +/// An enum representing the possible values of an `CreateCreditNote`'s `email_type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreditNoteEmailType { + CreditNote, + None, +} + +impl CreditNoteEmailType { + pub fn as_str(self) -> &'static str { + match self { + CreditNoteEmailType::CreditNote => "credit_note", + CreditNoteEmailType::None => "none", + } + } +} + +impl AsRef for CreditNoteEmailType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreditNoteEmailType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreditNoteEmailType { + fn default() -> Self { + Self::CreditNote + } +} + /// 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")] @@ -634,3 +699,39 @@ impl std::default::Default for CreditNoteType { Self::PostPayment } } + +/// An enum representing the possible values of an `CreditNotesPretaxCreditAmount`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreditNotesPretaxCreditAmountType { + CreditBalanceTransaction, + Discount, +} + +impl CreditNotesPretaxCreditAmountType { + pub fn as_str(self) -> &'static str { + match self { + CreditNotesPretaxCreditAmountType::CreditBalanceTransaction => { + "credit_balance_transaction" + } + CreditNotesPretaxCreditAmountType::Discount => "discount", + } + } +} + +impl AsRef for CreditNotesPretaxCreditAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreditNotesPretaxCreditAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreditNotesPretaxCreditAmountType { + fn default() -> Self { + Self::CreditBalanceTransaction + } +} diff --git a/src/resources/generated/credit_note_line_item.rs b/src/resources/generated/credit_note_line_item.rs index 4461be9d3..53108733a 100644 --- a/src/resources/generated/credit_note_line_item.rs +++ b/src/resources/generated/credit_note_line_item.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use crate::ids::CreditNoteLineItemId; use crate::params::{Expandable, Object}; -use crate::resources::{Discount, TaxRate}; +use crate::resources::{BillingCreditBalanceTransaction, Discount, TaxRate}; /// The resource representing a Stripe "CreditNoteLineItem". /// @@ -38,6 +38,9 @@ pub struct CreditNoteLineItem { /// 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 pretax_credit_amounts: Option>, + /// The number of units of product being credited. pub quantity: Option, @@ -93,6 +96,24 @@ pub struct CreditNoteTaxAmount { pub taxable_amount: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreditNotesPretaxCreditAmount { + /// The amount, in cents (or local equivalent), of the pretax credit amount. + pub amount: i64, + + /// The credit balance transaction that was applied to get this pretax credit amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_balance_transaction: Option>, + + /// The discount that was applied to get this pretax credit amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option>, + + /// Type of the pretax credit amount referenced. + #[serde(rename = "type")] + pub type_: CreditNotesPretaxCreditAmountType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct DiscountsResourceDiscountAmount { /// The amount, in cents (or local equivalent), of the discount. @@ -195,3 +216,39 @@ impl std::default::Default for CreditNoteTaxAmountTaxabilityReason { Self::CustomerExempt } } + +/// An enum representing the possible values of an `CreditNotesPretaxCreditAmount`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreditNotesPretaxCreditAmountType { + CreditBalanceTransaction, + Discount, +} + +impl CreditNotesPretaxCreditAmountType { + pub fn as_str(self) -> &'static str { + match self { + CreditNotesPretaxCreditAmountType::CreditBalanceTransaction => { + "credit_balance_transaction" + } + CreditNotesPretaxCreditAmountType::Discount => "discount", + } + } +} + +impl AsRef for CreditNotesPretaxCreditAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreditNotesPretaxCreditAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreditNotesPretaxCreditAmountType { + fn default() -> Self { + Self::CreditBalanceTransaction + } +} diff --git a/src/resources/generated/customer.rs b/src/resources/generated/customer.rs index eae9fe5b6..d3d8eb635 100644 --- a/src/resources/generated/customer.rs +++ b/src/resources/generated/customer.rs @@ -10,8 +10,8 @@ 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, + Address, CashBalance, Currency, Discount, PaymentMethod, PaymentSource, PaymentSourceParams, + Shipping, Subscription, TaxId, TestHelpersTestClock, }; /// The resource representing a Stripe "Customer". @@ -117,6 +117,8 @@ pub struct Customer { pub name: Option, /// The suffix of the customer's next invoice number (for example, 0001). + /// + /// When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses. #[serde(skip_serializing_if = "Option::is_none")] pub next_invoice_sequence: Option, @@ -250,7 +252,7 @@ pub struct InvoiceSettingCustomerSetting { pub footer: Option, /// Default options for invoice PDF rendering for this customer. - pub rendering_options: Option, + pub rendering_options: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -262,6 +264,17 @@ pub struct InvoiceSettingCustomField { pub value: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct InvoiceSettingCustomerRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + pub amount_tax_display: Option, + + /// ID of the invoice rendering template to be used for this customer's invoices. + /// + /// If set, the template will be used on all invoices for this customer unless a template is set directly on the invoice. + pub template: Option, +} + /// The parameters for `Customer::create`. #[derive(Clone, Debug, Serialize, Default)] pub struct CreateCustomer<'a> { @@ -338,7 +351,7 @@ pub struct CreateCustomer<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub preferred_locales: Option>, - /// The API ID of a promotion code to apply to the customer. + /// The 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. @@ -409,6 +422,7 @@ impl<'a> CreateCustomer<'a> { /// The parameters for `Customer::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListCustomers<'a> { + /// Only return customers that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, @@ -549,7 +563,7 @@ pub struct UpdateCustomer<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub preferred_locales: Option>, - /// The API ID of a promotion code to apply to the customer. + /// The 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. @@ -667,7 +681,7 @@ pub struct CustomerInvoiceSettings { #[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`. + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `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, @@ -753,12 +767,12 @@ pub struct CreateCustomerShippingAddress { pub struct CustomerInvoiceSettingsCustomFields { /// The name of the custom field. /// - /// This may be up to 30 characters. + /// This may be up to 40 characters. pub name: String, /// The value of the custom field. /// - /// This may be up to 30 characters. + /// This may be up to 140 characters. pub value: String, } @@ -771,6 +785,10 @@ pub struct CustomerInvoiceSettingsRenderingOptions { /// `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, + + /// ID of the invoice rendering template to use for future invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub template: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1076,6 +1094,7 @@ pub enum TaxIdType { AuAbn, AuArn, BgUic, + BhVat, BoTin, BrCnpj, BrCpf, @@ -1085,11 +1104,13 @@ pub enum TaxIdType { CaPstMb, CaPstSk, CaQst, + ChUid, ChVat, ClTin, CnTin, CoNit, CrTin, + DeStn, DoRcn, EcRuc, EgTin, @@ -1099,6 +1120,7 @@ pub enum TaxIdType { GbVat, GeVat, HkBr, + HrOib, HuTin, IdNpwp, IlVat, @@ -1109,13 +1131,17 @@ pub enum TaxIdType { JpTrn, KePin, KrBrn, + KzBin, LiUid, MxRfc, MyFrp, MyItn, MySst, + NgTin, NoVat, + NoVoec, NzGst, + OmVat, PeRuc, PhTin, RoTin, @@ -1147,6 +1173,7 @@ impl TaxIdType { TaxIdType::AuAbn => "au_abn", TaxIdType::AuArn => "au_arn", TaxIdType::BgUic => "bg_uic", + TaxIdType::BhVat => "bh_vat", TaxIdType::BoTin => "bo_tin", TaxIdType::BrCnpj => "br_cnpj", TaxIdType::BrCpf => "br_cpf", @@ -1156,11 +1183,13 @@ impl TaxIdType { TaxIdType::CaPstMb => "ca_pst_mb", TaxIdType::CaPstSk => "ca_pst_sk", TaxIdType::CaQst => "ca_qst", + TaxIdType::ChUid => "ch_uid", TaxIdType::ChVat => "ch_vat", TaxIdType::ClTin => "cl_tin", TaxIdType::CnTin => "cn_tin", TaxIdType::CoNit => "co_nit", TaxIdType::CrTin => "cr_tin", + TaxIdType::DeStn => "de_stn", TaxIdType::DoRcn => "do_rcn", TaxIdType::EcRuc => "ec_ruc", TaxIdType::EgTin => "eg_tin", @@ -1170,6 +1199,7 @@ impl TaxIdType { TaxIdType::GbVat => "gb_vat", TaxIdType::GeVat => "ge_vat", TaxIdType::HkBr => "hk_br", + TaxIdType::HrOib => "hr_oib", TaxIdType::HuTin => "hu_tin", TaxIdType::IdNpwp => "id_npwp", TaxIdType::IlVat => "il_vat", @@ -1180,13 +1210,17 @@ impl TaxIdType { TaxIdType::JpTrn => "jp_trn", TaxIdType::KePin => "ke_pin", TaxIdType::KrBrn => "kr_brn", + TaxIdType::KzBin => "kz_bin", TaxIdType::LiUid => "li_uid", TaxIdType::MxRfc => "mx_rfc", TaxIdType::MyFrp => "my_frp", TaxIdType::MyItn => "my_itn", TaxIdType::MySst => "my_sst", + TaxIdType::NgTin => "ng_tin", TaxIdType::NoVat => "no_vat", + TaxIdType::NoVoec => "no_voec", TaxIdType::NzGst => "nz_gst", + TaxIdType::OmVat => "om_vat", TaxIdType::PeRuc => "pe_ruc", TaxIdType::PhTin => "ph_tin", TaxIdType::RoTin => "ro_tin", diff --git a/src/resources/generated/customer_session.rs b/src/resources/generated/customer_session.rs index 5a8981edf..9ac4e8a22 100644 --- a/src/resources/generated/customer_session.rs +++ b/src/resources/generated/customer_session.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CustomerSession { - /// The client secret of this customer session. + /// 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. @@ -29,10 +29,10 @@ pub struct CustomerSession { /// Measured in seconds since the Unix epoch. pub created: Timestamp, - /// The customer the customer session was created for. + /// The Customer the Customer Session was created for. pub customer: Expandable, - /// The timestamp at which this customer session will expire. + /// 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. @@ -41,7 +41,7 @@ pub struct CustomerSession { 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. + /// 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 { #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/customer_sessions", ¶ms) @@ -61,6 +61,8 @@ pub struct CustomerSessionResourceComponents { pub buy_button: CustomerSessionResourceComponentsResourceBuyButton, + pub payment_element: CustomerSessionResourceComponentsResourcePaymentElement, + pub pricing_table: CustomerSessionResourceComponentsResourcePricingTable, } @@ -71,6 +73,54 @@ pub struct CustomerSessionResourceComponentsResourceBuyButton { pub enabled: bool, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CustomerSessionResourceComponentsResourcePaymentElement { + + /// Whether the Payment Element is enabled. + pub enabled: bool, + + /// This hash defines whether the Payment Element supports certain features. + pub features: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CustomerSessionResourceComponentsResourcePaymentElementResourceFeatures { + + /// A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. + /// + /// If not specified, defaults to ["always"]. + /// + /// In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. + pub payment_method_allow_redisplay_filters: Vec, + + /// Controls whether or not the Payment Element shows saved payment methods. + /// + /// This parameter defaults to `disabled`. + pub payment_method_redisplay: CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRedisplay, + + /// Determines the max number of saved payment methods for the Payment Element to display. + /// + /// This parameter defaults to `3`. + pub payment_method_redisplay_limit: Option, + + /// Controls whether the Payment Element displays the option to remove a saved payment method. + /// + /// This parameter defaults to `disabled`. Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. + /// Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). + pub payment_method_remove: CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRemove, + + /// Controls whether the Payment Element displays a checkbox offering to save a new payment method. + /// + /// This parameter defaults to `disabled`. If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. + /// For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. + pub payment_method_save: CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSave, + + /// When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. + /// + /// When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation. + pub payment_method_save_usage: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CustomerSessionResourceComponentsResourcePricingTable { @@ -87,7 +137,7 @@ pub struct CreateCustomerSession<'a> { /// Exactly 1 component must be enabled. pub components: CreateCustomerSessionComponents, - /// The ID of an existing customer for which to create the customer session. + /// 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. @@ -112,6 +162,10 @@ pub struct CreateCustomerSessionComponents { #[serde(skip_serializing_if = "Option::is_none")] pub buy_button: Option, + /// Configuration for the Payment Element. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_element: Option, + /// Configuration for the pricing table. #[serde(skip_serializing_if = "Option::is_none")] pub pricing_table: Option, @@ -124,9 +178,408 @@ pub struct CreateCustomerSessionComponentsBuyButton { pub enabled: bool, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCustomerSessionComponentsPaymentElement { + + /// Whether the Payment Element is enabled. + pub enabled: bool, + + /// This hash defines whether the Payment Element supports certain features. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCustomerSessionComponentsPricingTable { /// Whether the pricing table is enabled. pub enabled: bool, } + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCustomerSessionComponentsPaymentElementFeatures { + + /// A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. + /// + /// If not specified, defaults to ["always"]. + /// + /// In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_allow_redisplay_filters: Option>, + + /// Controls whether or not the Payment Element shows saved payment methods. + /// + /// This parameter defaults to `disabled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_redisplay: Option, + + /// Determines the max number of saved payment methods for the Payment Element to display. + /// + /// This parameter defaults to `3`. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_redisplay_limit: Option, + + /// Controls whether the Payment Element displays the option to remove a saved payment method. + /// + /// This parameter defaults to `disabled`. Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. + /// Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_remove: Option, + + /// Controls whether the Payment Element displays a checkbox offering to save a new payment method. + /// + /// This parameter defaults to `disabled`. If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. + /// For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_save: Option, + + /// When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. + /// + /// When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_save_usage: Option, +} + +/// An enum representing the possible values of an `CreateCustomerSessionComponentsPaymentElementFeatures`'s `payment_method_allow_redisplay_filters` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilters { + Always, + Limited, + Unspecified, +} + +impl CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilters { + pub fn as_str(self) -> &'static str { + match self { + CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilters::Always => "always", + CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilters::Limited => "limited", + CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilters::Unspecified => "unspecified", + } + } +} + +impl AsRef for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilters { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilters { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilters { + fn default() -> Self { + Self::Always + } +} + +/// An enum representing the possible values of an `CreateCustomerSessionComponentsPaymentElementFeatures`'s `payment_method_redisplay` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay { + Disabled, + Enabled, +} + +impl CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay { + pub fn as_str(self) -> &'static str { + match self { + CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay::Disabled => "disabled", + CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay::Enabled => "enabled", + } + } +} + +impl AsRef for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay { + fn default() -> Self { + Self::Disabled + } +} + +/// An enum representing the possible values of an `CreateCustomerSessionComponentsPaymentElementFeatures`'s `payment_method_remove` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove { + Disabled, + Enabled, +} + +impl CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove { + pub fn as_str(self) -> &'static str { + match self { + CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove::Disabled => "disabled", + CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove::Enabled => "enabled", + } + } +} + +impl AsRef for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove { + fn default() -> Self { + Self::Disabled + } +} + +/// An enum representing the possible values of an `CreateCustomerSessionComponentsPaymentElementFeatures`'s `payment_method_save` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave { + Disabled, + Enabled, +} + +impl CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave { + pub fn as_str(self) -> &'static str { + match self { + CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave::Disabled => "disabled", + CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave::Enabled => "enabled", + } + } +} + +impl AsRef for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave { + fn default() -> Self { + Self::Disabled + } +} + +/// An enum representing the possible values of an `CreateCustomerSessionComponentsPaymentElementFeatures`'s `payment_method_save_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage { + OffSession, + OnSession, +} + +impl CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage { + pub fn as_str(self) -> &'static str { + match self { + CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage::OffSession => "off_session", + CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage::OnSession => "on_session", + } + } +} + +impl AsRef for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage { + fn default() -> Self { + Self::OffSession + } +} + +/// An enum representing the possible values of an `CustomerSessionResourceComponentsResourcePaymentElementResourceFeatures`'s `payment_method_allow_redisplay_filters` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodAllowRedisplayFilters { + Always, + Limited, + Unspecified, +} + +impl CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodAllowRedisplayFilters { + pub fn as_str(self) -> &'static str { + match self { + CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodAllowRedisplayFilters::Always => "always", + CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodAllowRedisplayFilters::Limited => "limited", + CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodAllowRedisplayFilters::Unspecified => "unspecified", + } + } +} + +impl AsRef for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodAllowRedisplayFilters { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodAllowRedisplayFilters { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodAllowRedisplayFilters { + fn default() -> Self { + Self::Always + } +} + +/// An enum representing the possible values of an `CustomerSessionResourceComponentsResourcePaymentElementResourceFeatures`'s `payment_method_redisplay` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRedisplay { + Disabled, + Enabled, +} + +impl CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRedisplay { + pub fn as_str(self) -> &'static str { + match self { + CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRedisplay::Disabled => "disabled", + CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRedisplay::Enabled => "enabled", + } + } +} + +impl AsRef for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRedisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRedisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRedisplay { + fn default() -> Self { + Self::Disabled + } +} + +/// An enum representing the possible values of an `CustomerSessionResourceComponentsResourcePaymentElementResourceFeatures`'s `payment_method_remove` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRemove { + Disabled, + Enabled, +} + +impl CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRemove { + pub fn as_str(self) -> &'static str { + match self { + CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRemove::Disabled => "disabled", + CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRemove::Enabled => "enabled", + } + } +} + +impl AsRef for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRemove { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRemove { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodRemove { + fn default() -> Self { + Self::Disabled + } +} + +/// An enum representing the possible values of an `CustomerSessionResourceComponentsResourcePaymentElementResourceFeatures`'s `payment_method_save` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSave { + Disabled, + Enabled, +} + +impl CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSave { + pub fn as_str(self) -> &'static str { + match self { + CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSave::Disabled => "disabled", + CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSave::Enabled => "enabled", + } + } +} + +impl AsRef for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSave { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSave { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSave { + fn default() -> Self { + Self::Disabled + } +} + +/// An enum representing the possible values of an `CustomerSessionResourceComponentsResourcePaymentElementResourceFeatures`'s `payment_method_save_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSaveUsage { + OffSession, + OnSession, +} + +impl CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSaveUsage { + pub fn as_str(self) -> &'static str { + match self { + CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSaveUsage::OffSession => "off_session", + CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSaveUsage::OnSession => "on_session", + } + } +} + +impl AsRef for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSaveUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSaveUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CustomerSessionResourceComponentsResourcePaymentElementResourceFeaturesPaymentMethodSaveUsage { + fn default() -> Self { + Self::OffSession + } +} diff --git a/src/resources/generated/discount.rs b/src/resources/generated/discount.rs index 4ab82cd45..9059231c0 100644 --- a/src/resources/generated/discount.rs +++ b/src/resources/generated/discount.rs @@ -53,6 +53,9 @@ pub struct Discount { /// The subscription that this coupon is applied to, if it is applied to a particular subscription. pub subscription: Option, + + /// The subscription item that this coupon is applied to, if it is applied to a particular subscription item. + pub subscription_item: Option, } impl Object for Discount { diff --git a/src/resources/generated/dispute.rs b/src/resources/generated/dispute.rs index d150d9f06..c23c898ae 100644 --- a/src/resources/generated/dispute.rs +++ b/src/resources/generated/dispute.rs @@ -224,14 +224,29 @@ pub struct DisputeEvidenceDetails { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct DisputePaymentMethodDetails { - /// Card specific dispute details. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + + #[serde(skip_serializing_if = "Option::is_none")] pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + /// Payment method type. #[serde(rename = "type")] pub type_: DisputePaymentMethodDetailsType, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct DisputePaymentMethodDetailsAmazonPay { + /// The AmazonPay dispute type, chargeback or claim. + pub dispute_type: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct DisputePaymentMethodDetailsCard { /// Card brand. @@ -239,12 +254,32 @@ pub struct DisputePaymentMethodDetailsCard { /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. pub brand: String, + /// The type of dispute opened. + /// + /// Different case types may have varying fees and financial impact. + pub case_type: DisputePaymentMethodDetailsCardCaseType, + /// 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, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct DisputePaymentMethodDetailsKlarna { + /// The reason for the dispute as defined by Klarna. + pub reason_code: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct DisputePaymentMethodDetailsPaypal { + /// The ID of the dispute in PayPal. + pub case_id: Option, + + /// The reason for the dispute as defined by PayPal. + pub reason_code: Option, +} + /// The parameters for `Dispute::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListDisputes<'a> { @@ -252,6 +287,7 @@ pub struct ListDisputes<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub charge: Option, + /// Only return disputes that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, @@ -303,17 +339,91 @@ impl Paginable for ListDisputes<'_> { self.starting_after = Some(item.id()); } } +/// An enum representing the possible values of an `DisputePaymentMethodDetailsAmazonPay`'s `dispute_type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum DisputePaymentMethodDetailsAmazonPayDisputeType { + Chargeback, + Claim, +} + +impl DisputePaymentMethodDetailsAmazonPayDisputeType { + pub fn as_str(self) -> &'static str { + match self { + DisputePaymentMethodDetailsAmazonPayDisputeType::Chargeback => "chargeback", + DisputePaymentMethodDetailsAmazonPayDisputeType::Claim => "claim", + } + } +} + +impl AsRef for DisputePaymentMethodDetailsAmazonPayDisputeType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for DisputePaymentMethodDetailsAmazonPayDisputeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for DisputePaymentMethodDetailsAmazonPayDisputeType { + fn default() -> Self { + Self::Chargeback + } +} + +/// An enum representing the possible values of an `DisputePaymentMethodDetailsCard`'s `case_type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum DisputePaymentMethodDetailsCardCaseType { + Chargeback, + Inquiry, +} + +impl DisputePaymentMethodDetailsCardCaseType { + pub fn as_str(self) -> &'static str { + match self { + DisputePaymentMethodDetailsCardCaseType::Chargeback => "chargeback", + DisputePaymentMethodDetailsCardCaseType::Inquiry => "inquiry", + } + } +} + +impl AsRef for DisputePaymentMethodDetailsCardCaseType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for DisputePaymentMethodDetailsCardCaseType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for DisputePaymentMethodDetailsCardCaseType { + fn default() -> Self { + Self::Chargeback + } +} + /// 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 { + AmazonPay, Card, + Klarna, + Paypal, } impl DisputePaymentMethodDetailsType { pub fn as_str(self) -> &'static str { match self { + DisputePaymentMethodDetailsType::AmazonPay => "amazon_pay", DisputePaymentMethodDetailsType::Card => "card", + DisputePaymentMethodDetailsType::Klarna => "klarna", + DisputePaymentMethodDetailsType::Paypal => "paypal", } } } @@ -331,7 +441,7 @@ impl std::fmt::Display for DisputePaymentMethodDetailsType { } impl std::default::Default for DisputePaymentMethodDetailsType { fn default() -> Self { - Self::Card + Self::AmazonPay } } diff --git a/src/resources/generated/entitlements_active_entitlement.rs b/src/resources/generated/entitlements_active_entitlement.rs new file mode 100644 index 000000000..0b4fbcfe1 --- /dev/null +++ b/src/resources/generated/entitlements_active_entitlement.rs @@ -0,0 +1,38 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{EntitlementsActiveEntitlementId}; +use crate::params::{Expandable, Object}; +use crate::resources::{EntitlementsFeature}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "ActiveEntitlement". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct EntitlementsActiveEntitlement { + /// Unique identifier for the object. + pub id: EntitlementsActiveEntitlementId, + + /// The [Feature](https://stripe.com/docs/api/entitlements/feature) that the customer is entitled to. + pub feature: 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, + + /// A unique key you provide as your own system identifier. + /// + /// This may be up to 80 characters. + pub lookup_key: String, +} + +impl Object for EntitlementsActiveEntitlement { + type Id = EntitlementsActiveEntitlementId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "entitlements.active_entitlement" + } +} diff --git a/src/resources/generated/entitlements_active_entitlement_summary.rs b/src/resources/generated/entitlements_active_entitlement_summary.rs new file mode 100644 index 000000000..b7c92bea1 --- /dev/null +++ b/src/resources/generated/entitlements_active_entitlement_summary.rs @@ -0,0 +1,29 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::params::{List, Object}; +use crate::resources::{EntitlementsActiveEntitlement}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "ActiveEntitlementSummary". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct EntitlementsActiveEntitlementSummary { + + /// The customer that is entitled to this feature. + pub customer: String, + + /// The list of entitlements this customer has. + pub entitlements: 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, +} + +impl Object for EntitlementsActiveEntitlementSummary { + type Id = (); + fn id(&self) -> Self::Id {} + fn object(&self) -> &'static str { + "entitlements.active_entitlement_summary" + } +} diff --git a/src/resources/generated/entitlements_active_entitlement_summary_updated.rs b/src/resources/generated/entitlements_active_entitlement_summary_updated.rs new file mode 100644 index 000000000..f1326bc13 --- /dev/null +++ b/src/resources/generated/entitlements_active_entitlement_summary_updated.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "entitlements.active_entitlement_summary.updated". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct EntitlementsActiveEntitlementSummaryUpdated { +} diff --git a/src/resources/generated/entitlements_feature.rs b/src/resources/generated/entitlements_feature.rs new file mode 100644 index 000000000..1fde068a2 --- /dev/null +++ b/src/resources/generated/entitlements_feature.rs @@ -0,0 +1,45 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{EntitlementsFeatureId}; +use crate::params::{Metadata, Object}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "Feature". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct EntitlementsFeature { + /// Unique identifier for the object. + pub id: EntitlementsFeatureId, + + /// Inactive features cannot be attached to new products and will not be returned from the features list endpoint. + pub active: 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, + + /// A unique key you provide as your own system identifier. + /// + /// This may be up to 80 characters. + pub lookup_key: String, + + /// 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. + pub metadata: Metadata, + + /// The feature's name, for your own purpose, not meant to be displayable to the customer. + pub name: String, +} + +impl Object for EntitlementsFeature { + type Id = EntitlementsFeatureId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "entitlements.feature" + } +} diff --git a/src/resources/generated/event.rs b/src/resources/generated/event.rs index 8bfb0c8a1..c2b6eb864 100644 --- a/src/resources/generated/event.rs +++ b/src/resources/generated/event.rs @@ -50,12 +50,12 @@ pub struct Event { 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). + /// Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/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", params) } - /// Retrieves the details of an event. + /// Retrieves the details of an event if it was created in the last 30 days. /// /// 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 { @@ -90,6 +90,7 @@ pub struct NotificationEventRequest { /// The parameters for `Event::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListEvents<'a> { + /// Only return events that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, diff --git a/src/resources/generated/file.rs b/src/resources/generated/file.rs index 24bfa30a6..3a48cb197 100644 --- a/src/resources/generated/file.rs +++ b/src/resources/generated/file.rs @@ -79,6 +79,7 @@ impl Object for File { /// The parameters for `File::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListFiles<'a> { + /// Only return files that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, @@ -145,6 +146,7 @@ pub enum FilePurpose { FinanceReportRun, IdentityDocument, IdentityDocumentDownloadable, + IssuingRegulatoryReporting, PciDocument, Selfie, SigmaScheduledQuery, @@ -165,6 +167,7 @@ impl FilePurpose { FilePurpose::FinanceReportRun => "finance_report_run", FilePurpose::IdentityDocument => "identity_document", FilePurpose::IdentityDocumentDownloadable => "identity_document_downloadable", + FilePurpose::IssuingRegulatoryReporting => "issuing_regulatory_reporting", FilePurpose::PciDocument => "pci_document", FilePurpose::Selfie => "selfie", FilePurpose::SigmaScheduledQuery => "sigma_scheduled_query", diff --git a/src/resources/generated/file_link.rs b/src/resources/generated/file_link.rs index fad3a59a7..a9e5f0491 100644 --- a/src/resources/generated/file_link.rs +++ b/src/resources/generated/file_link.rs @@ -96,7 +96,7 @@ pub struct CreateFileLink<'a> { /// 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`. + /// The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `issuing_regulatory_reporting`, `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. @@ -122,6 +122,7 @@ impl<'a> CreateFileLink<'a> { /// The parameters for `FileLink::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListFileLinks<'a> { + /// Only return links that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, diff --git a/src/resources/generated/financial_connections_account.rs b/src/resources/generated/financial_connections_account.rs index a7a2f7ed7..f04164493 100644 --- a/src/resources/generated/financial_connections_account.rs +++ b/src/resources/generated/financial_connections_account.rs @@ -110,7 +110,7 @@ pub struct BankConnectionsResourceBalance { #[serde(skip_serializing_if = "Option::is_none")] pub credit: Option, - /// The balances owed to (or by) the account holder. + /// The balances owed to (or by) the account holder, before subtracting any outbound pending transactions or adding any inbound pending transactions. /// /// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. /// @@ -132,7 +132,7 @@ 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. + /// Typically this is the current balance after subtracting any outbound pending transactions and adding any inbound pending transactions. 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, @@ -178,6 +178,12 @@ pub struct BankConnectionsResourceOwnershipRefresh { /// Measured in seconds since the Unix epoch. pub last_attempted_at: Timestamp, + /// Time at which the next ownership 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: BankConnectionsResourceOwnershipRefreshStatus, } diff --git a/src/resources/generated/financial_connections_account_refreshed_ownership.rs b/src/resources/generated/financial_connections_account_refreshed_ownership.rs new file mode 100644 index 000000000..890f2548c --- /dev/null +++ b/src/resources/generated/financial_connections_account_refreshed_ownership.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "financial_connections.account.refreshed_ownership". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct FinancialConnectionsAccountRefreshedOwnership { +} diff --git a/src/resources/generated/financial_connections_session.rs b/src/resources/generated/financial_connections_session.rs index 17e2358d8..e6039bec3 100644 --- a/src/resources/generated/financial_connections_session.rs +++ b/src/resources/generated/financial_connections_session.rs @@ -68,6 +68,11 @@ impl Object for FinancialConnectionsSession { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct BankConnectionsResourceLinkAccountSessionFilters { + /// Restricts the Session to subcategories of accounts that can be linked. + /// + /// Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. + pub account_subcategories: Option>, + /// List of countries from which to filter accounts. pub countries: Option>, } @@ -139,8 +144,55 @@ pub struct CreateFinancialConnectionsSessionAccountHolder { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateFinancialConnectionsSessionFilters { + /// Restricts the Session to subcategories of accounts that can be linked. + /// + /// Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_subcategories: Option>, + /// List of countries from which to collect accounts. - pub countries: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub countries: Option>, +} + +/// An enum representing the possible values of an `BankConnectionsResourceLinkAccountSessionFilters`'s `account_subcategories` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum BankConnectionsResourceLinkAccountSessionFiltersAccountSubcategories { + Checking, + CreditCard, + LineOfCredit, + Mortgage, + Savings, +} + +impl BankConnectionsResourceLinkAccountSessionFiltersAccountSubcategories { + pub fn as_str(self) -> &'static str { + match self { + BankConnectionsResourceLinkAccountSessionFiltersAccountSubcategories::Checking => "checking", + BankConnectionsResourceLinkAccountSessionFiltersAccountSubcategories::CreditCard => "credit_card", + BankConnectionsResourceLinkAccountSessionFiltersAccountSubcategories::LineOfCredit => "line_of_credit", + BankConnectionsResourceLinkAccountSessionFiltersAccountSubcategories::Mortgage => "mortgage", + BankConnectionsResourceLinkAccountSessionFiltersAccountSubcategories::Savings => "savings", + } + } +} + +impl AsRef for BankConnectionsResourceLinkAccountSessionFiltersAccountSubcategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for BankConnectionsResourceLinkAccountSessionFiltersAccountSubcategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for BankConnectionsResourceLinkAccountSessionFiltersAccountSubcategories { + fn default() -> Self { + Self::Checking + } } /// An enum representing the possible values of an `CreateFinancialConnectionsSessionAccountHolder`'s `type` field. @@ -177,6 +229,46 @@ impl std::default::Default for CreateFinancialConnectionsSessionAccountHolderTyp } } +/// An enum representing the possible values of an `CreateFinancialConnectionsSessionFilters`'s `account_subcategories` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateFinancialConnectionsSessionFiltersAccountSubcategories { + Checking, + CreditCard, + LineOfCredit, + Mortgage, + Savings, +} + +impl CreateFinancialConnectionsSessionFiltersAccountSubcategories { + pub fn as_str(self) -> &'static str { + match self { + CreateFinancialConnectionsSessionFiltersAccountSubcategories::Checking => "checking", + CreateFinancialConnectionsSessionFiltersAccountSubcategories::CreditCard => "credit_card", + CreateFinancialConnectionsSessionFiltersAccountSubcategories::LineOfCredit => "line_of_credit", + CreateFinancialConnectionsSessionFiltersAccountSubcategories::Mortgage => "mortgage", + CreateFinancialConnectionsSessionFiltersAccountSubcategories::Savings => "savings", + } + } +} + +impl AsRef for CreateFinancialConnectionsSessionFiltersAccountSubcategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateFinancialConnectionsSessionFiltersAccountSubcategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateFinancialConnectionsSessionFiltersAccountSubcategories { + fn default() -> Self { + Self::Checking + } +} + /// 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")] diff --git a/src/resources/generated/forwarding_request.rs b/src/resources/generated/forwarding_request.rs new file mode 100644 index 000000000..10ca6195c --- /dev/null +++ b/src/resources/generated/forwarding_request.rs @@ -0,0 +1,179 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{ForwardingRequestId}; +use crate::params::{Object, Timestamp}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "ForwardingRequest". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ForwardingRequest { + /// Unique identifier for the object. + pub id: ForwardingRequestId, + + /// 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 PaymentMethod to insert into the forwarded request. + /// + /// Forwarding previously consumed PaymentMethods is allowed. + pub payment_method: String, + + /// The field kinds to be replaced in the forwarded request. + pub replacements: Vec, + + /// Context about the request from Stripe's servers to the destination endpoint. + pub request_context: Option, + + /// The request that was sent to the destination endpoint. + /// + /// We redact any sensitive fields. + pub request_details: Option, + + /// The response that the destination endpoint returned to us. + /// + /// We redact any sensitive fields. + pub response_details: Option, + + /// The destination URL for the forwarded request. + /// + /// Must be supported by the config. + pub url: Option, +} + +impl Object for ForwardingRequest { + type Id = ForwardingRequestId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "forwarding.request" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ForwardedRequestContext { + + /// The time it took in milliseconds for the destination endpoint to respond. + pub destination_duration: i64, + + /// The IP address of the destination. + pub destination_ip_address: String, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ForwardedRequestDetails { + + /// The body payload to send to the destination endpoint. + pub body: String, + + /// The headers to include in the forwarded request. + /// + /// Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included. + pub headers: Vec, + + /// The HTTP method used to call the destination endpoint. + pub http_method: ForwardedRequestDetailsHttpMethod, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ForwardedRequestHeader { + + /// The header name. + pub name: String, + + /// The header value. + pub value: String, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ForwardedResponseDetails { + + /// The response body from the destination endpoint to Stripe. + pub body: String, + + /// HTTP headers that the destination endpoint returned. + pub headers: Vec, + + /// The HTTP status code that the destination endpoint returned. + pub status: i64, +} + +/// An enum representing the possible values of an `ForwardedRequestDetails`'s `http_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum ForwardedRequestDetailsHttpMethod { + #[serde(rename = "POST")] + Post, +} + +impl ForwardedRequestDetailsHttpMethod { + pub fn as_str(self) -> &'static str { + match self { + ForwardedRequestDetailsHttpMethod::Post => "POST", + } + } +} + +impl AsRef for ForwardedRequestDetailsHttpMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for ForwardedRequestDetailsHttpMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for ForwardedRequestDetailsHttpMethod { + fn default() -> Self { + Self::Post + } +} + +/// An enum representing the possible values of an `ForwardingRequest`'s `replacements` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum ForwardingRequestReplacements { + CardCvc, + CardExpiry, + CardNumber, + CardholderName, +} + +impl ForwardingRequestReplacements { + pub fn as_str(self) -> &'static str { + match self { + ForwardingRequestReplacements::CardCvc => "card_cvc", + ForwardingRequestReplacements::CardExpiry => "card_expiry", + ForwardingRequestReplacements::CardNumber => "card_number", + ForwardingRequestReplacements::CardholderName => "cardholder_name", + } + } +} + +impl AsRef for ForwardingRequestReplacements { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for ForwardingRequestReplacements { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for ForwardingRequestReplacements { + fn default() -> Self { + Self::CardCvc + } +} diff --git a/src/resources/generated/identity_verification_report.rs b/src/resources/generated/identity_verification_report.rs index d5c99bf97..5879465df 100644 --- a/src/resources/generated/identity_verification_report.rs +++ b/src/resources/generated/identity_verification_report.rs @@ -15,6 +15,11 @@ pub struct IdentityVerificationReport { /// Unique identifier for the object. pub id: IdentityVerificationReportId, + /// A string to reference this user. + /// + /// This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + pub client_reference_id: Option, + /// Time at which the object was created. /// /// Measured in seconds since the Unix epoch. @@ -23,6 +28,9 @@ pub struct IdentityVerificationReport { #[serde(skip_serializing_if = "Option::is_none")] pub document: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub id_number: Option, @@ -32,13 +40,19 @@ pub struct IdentityVerificationReport { #[serde(skip_serializing_if = "Option::is_none")] pub options: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub selfie: Option, /// Type of report. #[serde(rename = "type")] + pub type_: IdentityVerificationReportType, + + /// The configuration token of a Verification Flow from the dashboard. #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, + pub verification_flow: Option, /// ID of the VerificationSession that created this report. pub verification_session: Option, @@ -61,6 +75,7 @@ pub struct GelatoDocumentReport { pub address: Option
, /// Date of birth as it appears in the document. + #[serde(skip_serializing_if = "Option::is_none")] pub dob: Option, /// Details on the verification error. @@ -69,6 +84,7 @@ pub struct GelatoDocumentReport { pub error: Option, /// Expiration date of the document. + #[serde(skip_serializing_if = "Option::is_none")] pub expiration_date: Option, /// Array of [File](https://stripe.com/docs/api/files) ids containing images for this document. @@ -87,6 +103,7 @@ pub struct GelatoDocumentReport { pub last_name: Option, /// Document ID number. + #[serde(skip_serializing_if = "Option::is_none")] pub number: Option, /// Status of this `document` check. @@ -148,10 +165,38 @@ pub struct GelatoDocumentReportError { pub reason: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct GelatoEmailReport { + + /// Email to be verified. + pub email: Option, + + /// Details on the verification error. + /// + /// Present when status is `unverified`. + pub error: Option, + + /// Status of this `email` check. + pub status: GelatoEmailReportStatus, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct GelatoEmailReportError { + + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] pub dob: Option, /// Details on the verification error. @@ -165,6 +210,7 @@ pub struct GelatoIdNumberReport { /// ID number. /// /// When `id_number_type` is `us_ssn`, only the last 4 digits are present. + #[serde(skip_serializing_if = "Option::is_none")] pub id_number: Option, /// Type of ID number. @@ -202,6 +248,33 @@ pub struct GelatoIdNumberReportError { pub reason: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct GelatoPhoneReport { + + /// Details on the verification error. + /// + /// Present when status is `unverified`. + pub error: Option, + + /// Phone to be verified. + pub phone: Option, + + /// Status of this `phone` check. + pub status: GelatoPhoneReportStatus, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct GelatoPhoneReportError { + + /// 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 { @@ -376,6 +449,74 @@ impl std::default::Default for GelatoDocumentReportType { } } +/// An enum representing the possible values of an `GelatoEmailReportError`'s `code` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum GelatoEmailReportErrorCode { + EmailUnverifiedOther, + EmailVerificationDeclined, +} + +impl GelatoEmailReportErrorCode { + pub fn as_str(self) -> &'static str { + match self { + GelatoEmailReportErrorCode::EmailUnverifiedOther => "email_unverified_other", + GelatoEmailReportErrorCode::EmailVerificationDeclined => "email_verification_declined", + } + } +} + +impl AsRef for GelatoEmailReportErrorCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for GelatoEmailReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for GelatoEmailReportErrorCode { + fn default() -> Self { + Self::EmailUnverifiedOther + } +} + +/// An enum representing the possible values of an `GelatoEmailReport`'s `status` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum GelatoEmailReportStatus { + Unverified, + Verified, +} + +impl GelatoEmailReportStatus { + pub fn as_str(self) -> &'static str { + match self { + GelatoEmailReportStatus::Unverified => "unverified", + GelatoEmailReportStatus::Verified => "verified", + } + } +} + +impl AsRef for GelatoEmailReportStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for GelatoEmailReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for GelatoEmailReportStatus { + fn default() -> Self { + Self::Unverified + } +} + /// 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")] @@ -482,6 +623,74 @@ impl std::default::Default for GelatoIdNumberReportStatus { } } +/// An enum representing the possible values of an `GelatoPhoneReportError`'s `code` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum GelatoPhoneReportErrorCode { + PhoneUnverifiedOther, + PhoneVerificationDeclined, +} + +impl GelatoPhoneReportErrorCode { + pub fn as_str(self) -> &'static str { + match self { + GelatoPhoneReportErrorCode::PhoneUnverifiedOther => "phone_unverified_other", + GelatoPhoneReportErrorCode::PhoneVerificationDeclined => "phone_verification_declined", + } + } +} + +impl AsRef for GelatoPhoneReportErrorCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for GelatoPhoneReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for GelatoPhoneReportErrorCode { + fn default() -> Self { + Self::PhoneUnverifiedOther + } +} + +/// An enum representing the possible values of an `GelatoPhoneReport`'s `status` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum GelatoPhoneReportStatus { + Unverified, + Verified, +} + +impl GelatoPhoneReportStatus { + pub fn as_str(self) -> &'static str { + match self { + GelatoPhoneReportStatus::Unverified => "unverified", + GelatoPhoneReportStatus::Verified => "verified", + } + } +} + +impl AsRef for GelatoPhoneReportStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for GelatoPhoneReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for GelatoPhoneReportStatus { + 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")] @@ -596,6 +805,7 @@ impl std::default::Default for GelatoSelfieReportStatus { pub enum IdentityVerificationReportType { Document, IdNumber, + VerificationFlow, } impl IdentityVerificationReportType { @@ -603,6 +813,7 @@ impl IdentityVerificationReportType { match self { IdentityVerificationReportType::Document => "document", IdentityVerificationReportType::IdNumber => "id_number", + IdentityVerificationReportType::VerificationFlow => "verification_flow", } } } diff --git a/src/resources/generated/identity_verification_session.rs b/src/resources/generated/identity_verification_session.rs index 187d047c2..8ec693fd8 100644 --- a/src/resources/generated/identity_verification_session.rs +++ b/src/resources/generated/identity_verification_session.rs @@ -15,6 +15,11 @@ pub struct IdentityVerificationSession { /// Unique identifier for the object. pub id: IdentityVerificationSessionId, + /// A string to reference this user. + /// + /// This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + pub client_reference_id: Option, + /// 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. @@ -47,11 +52,20 @@ pub struct IdentityVerificationSession { /// A set of options for the session’s verification checks. pub options: Option, + /// Details provided about the user being verified. + /// + /// These details may be shown to the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub provided_details: Option, + /// Redaction status of this VerificationSession. /// /// If the VerificationSession is not redacted, this field will be null. pub redaction: Option, + /// Token referencing a Customer resource. + pub related_customer: Option, + /// Status of this VerificationSession. /// /// [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). @@ -59,7 +73,7 @@ pub struct IdentityVerificationSession { /// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. #[serde(rename = "type")] - pub type_: Option, + pub type_: IdentityVerificationSessionType, /// The short-lived URL that you use to redirect a user to Stripe to submit their identity information. /// @@ -68,7 +82,12 @@ pub struct IdentityVerificationSession { /// 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 configuration token of a Verification Flow from the dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_flow: Option, + /// The user’s verified data. + #[serde(skip_serializing_if = "Option::is_none")] pub verified_outputs: Option, } @@ -82,6 +101,18 @@ impl Object for IdentityVerificationSession { } } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct GelatoProvidedDetails { + + /// Email of user being verified. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + + /// Phone number of user being verified. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct GelatoSessionLastError { @@ -98,8 +129,14 @@ pub struct GelatoVerificationSessionOptions { #[serde(skip_serializing_if = "Option::is_none")] pub document: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub id_number: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -126,10 +163,26 @@ pub struct GelatoSessionDocumentOptions { pub require_matching_selfie: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct GelatoSessionEmailOptions { + + /// Request one time password verification of `provided_details.email`. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_verification: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct GelatoSessionIdNumberOptions { } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct GelatoSessionPhoneOptions { + + /// Request one time password verification of `provided_details.phone`. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_verification: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct GelatoVerifiedOutputs { @@ -137,12 +190,17 @@ pub struct GelatoVerifiedOutputs { pub address: Option
, /// The user’s verified date of birth. + #[serde(skip_serializing_if = "Option::is_none")] pub dob: Option, + /// The user's verified email address. + pub email: Option, + /// The user's verified first name. pub first_name: Option, /// The user's verified id number. + #[serde(skip_serializing_if = "Option::is_none")] pub id_number: Option, /// The user's verified id number type. @@ -150,6 +208,9 @@ pub struct GelatoVerifiedOutputs { /// The user's verified last name. pub last_name: Option, + + /// The user's verified phone number. + pub phone: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -219,9 +280,13 @@ pub enum GelatoSessionLastErrorCode { DocumentExpired, DocumentTypeNotSupported, DocumentUnverifiedOther, + EmailUnverifiedOther, + EmailVerificationDeclined, IdNumberInsufficientDocumentData, IdNumberMismatch, IdNumberUnverifiedOther, + PhoneUnverifiedOther, + PhoneVerificationDeclined, SelfieDocumentMissingPhoto, SelfieFaceMismatch, SelfieManipulated, @@ -239,9 +304,13 @@ impl GelatoSessionLastErrorCode { GelatoSessionLastErrorCode::DocumentExpired => "document_expired", GelatoSessionLastErrorCode::DocumentTypeNotSupported => "document_type_not_supported", GelatoSessionLastErrorCode::DocumentUnverifiedOther => "document_unverified_other", + GelatoSessionLastErrorCode::EmailUnverifiedOther => "email_unverified_other", + GelatoSessionLastErrorCode::EmailVerificationDeclined => "email_verification_declined", GelatoSessionLastErrorCode::IdNumberInsufficientDocumentData => "id_number_insufficient_document_data", GelatoSessionLastErrorCode::IdNumberMismatch => "id_number_mismatch", GelatoSessionLastErrorCode::IdNumberUnverifiedOther => "id_number_unverified_other", + GelatoSessionLastErrorCode::PhoneUnverifiedOther => "phone_unverified_other", + GelatoSessionLastErrorCode::PhoneVerificationDeclined => "phone_verification_declined", GelatoSessionLastErrorCode::SelfieDocumentMissingPhoto => "selfie_document_missing_photo", GelatoSessionLastErrorCode::SelfieFaceMismatch => "selfie_face_mismatch", GelatoSessionLastErrorCode::SelfieManipulated => "selfie_manipulated", @@ -348,6 +417,7 @@ impl std::default::Default for IdentityVerificationSessionStatus { pub enum IdentityVerificationSessionType { Document, IdNumber, + VerificationFlow, } impl IdentityVerificationSessionType { @@ -355,6 +425,7 @@ impl IdentityVerificationSessionType { match self { IdentityVerificationSessionType::Document => "document", IdentityVerificationSessionType::IdNumber => "id_number", + IdentityVerificationSessionType::VerificationFlow => "verification_flow", } } } diff --git a/src/resources/generated/invoice.rs b/src/resources/generated/invoice.rs index 5128f0c91..dec9a2fd1 100644 --- a/src/resources/generated/invoice.rs +++ b/src/resources/generated/invoice.rs @@ -11,12 +11,13 @@ use crate::params::{ 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, + Account, Address, ApiErrors, Application, BillingCreditBalanceTransaction, Charge, + ConnectAccountReference, Currency, Customer, Discount, InvoiceLineItem, + InvoicePaymentMethodOptionsAcssDebit, InvoicePaymentMethodOptionsBancontact, + InvoicePaymentMethodOptionsCustomerBalance, InvoicePaymentMethodOptionsKonbini, + InvoicePaymentMethodOptionsSepaDebit, InvoicePaymentMethodOptionsUsBankAccount, + InvoicesResourceShippingCost, Margin, PaymentIntent, PaymentMethod, PaymentSource, Quote, + Shipping, Subscription, TaxId, TaxRate, TestHelpersTestClock, }; /// The resource representing a Stripe "Invoice". @@ -77,6 +78,8 @@ pub struct Invoice { /// /// 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. + /// If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. + /// Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. #[serde(skip_serializing_if = "Option::is_none")] pub attempt_count: Option, @@ -95,6 +98,13 @@ pub struct Invoice { #[serde(skip_serializing_if = "Option::is_none")] pub automatic_tax: Option, + /// The time when this invoice is currently scheduled to be automatically finalized. + /// + /// The field will be `null` if the invoice is not scheduled to finalize in the future. + /// If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatically_finalizes_at: Option, + /// Indicates the reason why the invoice was created. /// /// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. @@ -254,7 +264,7 @@ pub struct Invoice { /// /// 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, + pub from_invoice: Option, /// The URL for the hosted invoice page, which allows customers to view and pay an invoice. /// @@ -337,10 +347,16 @@ pub struct Invoice { pub payment_settings: Option, /// End of the usage period during which invoice items were added to this invoice. + /// + /// This looks back one period for a subscription invoice. + /// Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. #[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. + /// + /// This looks back one period for a subscription invoice. + /// Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. #[serde(skip_serializing_if = "Option::is_none")] pub period_start: Option, @@ -362,18 +378,11 @@ pub struct Invoice { /// 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, + pub rendering: 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, + pub shipping_cost: Option, /// Shipping details for the invoice. /// @@ -399,7 +408,7 @@ pub struct Invoice { pub status: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub status_transitions: Option, + pub status_transitions: Option, /// The subscription that this invoice was prepared for, if any. #[serde(skip_serializing_if = "Option::is_none")] @@ -452,6 +461,9 @@ pub struct Invoice { #[serde(skip_serializing_if = "Option::is_none")] pub total_excluding_tax: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub total_pretax_credit_amounts: Option>, + /// The aggregate amounts calculated per tax rate for all line items. #[serde(skip_serializing_if = "Option::is_none")] pub total_tax_amounts: Option>, @@ -489,6 +501,14 @@ impl Invoice { client.get_query(&format!("/invoices/{}", id), Expand { expand }) } + /// Updates multiple line items on an invoice. + /// + /// This is only possible when an invoice is still a draft. + pub fn update(client: &Client, id: &InvoiceId, params: UpdateInvoice<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] + client.post_form(&format!("/invoices/{}", id), ¶ms) + } + /// Permanently deletes a one-off invoice draft. /// /// This cannot be undone. @@ -592,33 +612,6 @@ pub struct InvoiceTransferData { 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. @@ -653,6 +646,9 @@ pub struct InvoicesPaymentMethodOptions { /// 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 `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent. + pub sepa_debit: 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, } @@ -665,7 +661,7 @@ pub struct InvoicePaymentMethodOptionsCard { /// 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. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. pub request_three_d_secure: Option, } @@ -675,9 +671,42 @@ pub struct InvoiceInstallmentsCard { pub enabled: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct InvoicesResourceFromInvoice { + /// 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 InvoicesResourceInvoiceRendering { + /// 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, + + /// ID of the rendering template that the invoice is formatted by. + pub template: Option, + + /// Version of the rendering template that the invoice is using. + pub template_version: 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 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`. + /// 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`, `hr_oib`, `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`, `no_voec`, `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`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown`. #[serde(rename = "type")] pub type_: TaxIdType, @@ -686,7 +715,29 @@ pub struct InvoicesResourceInvoiceTaxId { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesStatusTransitions { +pub struct InvoicesResourcePretaxCreditAmount { + /// The amount, in cents (or local equivalent), of the pretax credit amount. + pub amount: i64, + + /// The credit balance transaction that was applied to get this pretax credit amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_balance_transaction: Option>, + + /// The discount that was applied to get this pretax credit amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option>, + + /// The margin that was applied to get this pretax credit amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub margin: Option>, + + /// Type of the pretax credit amount referenced. + #[serde(rename = "type")] + pub type_: InvoicesResourcePretaxCreditAmountType, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct InvoicesResourceStatusTransitions { /// The time that the invoice draft was finalized. pub finalized_at: Option, @@ -702,9 +753,9 @@ pub struct InvoicesStatusTransitions { #[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. + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. /// - /// *Note: This attribute is populated only for invoices created on or after June 29, 2023.*. + /// Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization. *Note: This attribute is populated only for invoices created on or after June 29, 2023.*. pub metadata: Option, } @@ -787,7 +838,7 @@ pub struct CreateInvoice<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub description: Option<&'a str>, - /// The coupons to redeem into discounts for the invoice. + /// The coupons and promotion codes 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. @@ -836,6 +887,15 @@ pub struct CreateInvoice<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, + /// Set the number for this invoice. + /// + /// If no number is present then a number will be assigned automatically when the invoice is finalized. + /// In many markets, regulations require invoices to be unique, sequential and / or gapless. + /// You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. + /// If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub number: Option<&'a str>, + /// 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. @@ -849,9 +909,6 @@ pub struct CreateInvoice<'a> { /// 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, @@ -860,13 +917,6 @@ pub struct CreateInvoice<'a> { #[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, @@ -920,11 +970,11 @@ impl<'a> CreateInvoice<'a> { from_invoice: Default::default(), issuer: Default::default(), metadata: Default::default(), + number: 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(), @@ -943,6 +993,7 @@ pub struct ListInvoices<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub collection_method: Option, + /// Only return invoices that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, @@ -1010,6 +1061,32 @@ impl Paginable for ListInvoices<'_> { self.starting_after = Some(item.id()); } } +/// The parameters for `Invoice::update`. +#[derive(Clone, Debug, Serialize)] +pub struct UpdateInvoice<'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`. + /// For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_metadata: Option, + + /// The line items to update. + pub lines: Vec, +} + +impl<'a> UpdateInvoice<'a> { + pub fn new(lines: Vec) -> Self { + UpdateInvoice { expand: Default::default(), invoice_metadata: Default::default(), lines } + } +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateInvoiceAutomaticTax { /// Whether Stripe automatically computes tax on this invoice. @@ -1029,12 +1106,12 @@ pub struct CreateInvoiceAutomaticTax { pub struct CreateInvoiceCustomFields { /// The name of the custom field. /// - /// This may be up to 30 characters. + /// This may be up to 40 characters. pub name: String, /// The value of the custom field. /// - /// This may be up to 30 characters. + /// This may be up to 140 characters. pub value: String, } @@ -1047,6 +1124,10 @@ pub struct CreateInvoiceDiscounts { /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1104,17 +1185,14 @@ pub struct CreateInvoiceRendering { /// 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. + /// ID of the invoice rendering template to use for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub template: Option, + + /// The specific version of invoice rendering template to use for this invoice. #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: Option, + pub template_version: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1153,6 +1231,88 @@ pub struct CreateInvoiceTransferData { pub destination: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateInvoiceLines { + /// 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, + + /// 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, promotion codes & 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>, + + /// ID of an existing line item on the invoice. + pub id: 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. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + /// For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option, + + /// 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. + /// + /// 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, + + /// 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>, + + /// 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>, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateInvoiceAutomaticTaxLiability { /// The connected account being referenced when `type` is `account`. @@ -1186,6 +1346,10 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub konbini: Option, + /// If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: 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, @@ -1240,8 +1404,6 @@ pub struct CreateInvoiceShippingCostShippingRateData { 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, @@ -1274,6 +1436,91 @@ pub struct CreateInvoiceShippingDetailsAddress { pub state: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateInvoiceLinesDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateInvoiceLinesPeriod { + /// The end of the period, which must be greater than or equal to the start. + /// + /// This value is inclusive. + pub end: Timestamp, + + /// The start of the period. + /// + /// This value is inclusive. + pub start: Timestamp, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateInvoiceLinesPriceData { + /// Three-letter [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, + + /// 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 UpdateInvoiceLinesTaxAmounts { + /// 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: UpdateInvoiceLinesTaxAmountsTaxRateData, + + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: i64, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit { /// Additional fields for Mandate creation. @@ -1306,7 +1553,7 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCard { /// 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. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#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, @@ -1329,6 +1576,9 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalance { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsKonbini {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsSepaDebit {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount { /// Additional fields for Financial Connections Session creation. @@ -1375,6 +1625,77 @@ pub struct CreateInvoiceShippingCostShippingRateDataFixedAmount { Option>, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateInvoiceLinesPriceDataProductData { + /// 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 UpdateInvoiceLinesTaxAmountsTaxRateData { + /// 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, + + /// 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, + + /// The display name of the tax rate, which will be shown to users. + pub display_name: String, + + /// 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, + + /// 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, + + /// The high-level tax type, such as `vat` or `sales_tax`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_type: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { /// Transaction type of the mandate. @@ -1415,6 +1736,10 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTr #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections { + /// Provide filters for the linked accounts that the customer can select for the payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option, + /// The list of permissions to request. /// /// If this parameter is passed, the `payment_method` permission must be included. @@ -1460,12 +1785,18 @@ pub struct CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions { #[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 required. + /// + /// It represents the number of installment payments your customer will make to their credit card. + #[serde(skip_serializing_if = "Option::is_none")] + 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: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval, + /// For `fixed_count` installment plans, this is required. + /// + /// It represents the interval between installment payments your customer will make to their credit card. One of `month`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: + Option, /// Type of installment plan, one of `fixed_count`. #[serde(rename = "type")] @@ -1481,6 +1812,16 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTr pub country: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters { + + /// The account subcategories to use to filter for selectable accounts. + /// + /// Valid subcategories are `checking` and `savings`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_subcategories: Option>, +} + /// 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")] @@ -1891,6 +2232,41 @@ impl std::default::Default } } +/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`'s `account_subcategories` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories +{ + Checking, + Savings, +} + +impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + pub fn as_str(self) -> &'static str { + match self { + CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Checking => "checking", + CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Savings => "savings", + } + } +} + +impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn default() -> Self { + Self::Checking + } +} + /// 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")] @@ -1941,6 +2317,7 @@ impl std::default::Default #[serde(rename_all = "snake_case")] pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { Balances, + Ownership, Transactions, } @@ -1948,6 +2325,7 @@ impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne pub fn as_str(self) -> &'static str { match self { CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", + CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Ownership => "ownership", CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", } } @@ -2025,6 +2403,7 @@ pub enum CreateInvoicePaymentSettingsPaymentMethodTypes { AchCreditTransfer, AchDebit, AcssDebit, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -2039,13 +2418,16 @@ pub enum CreateInvoicePaymentSettingsPaymentMethodTypes { Ideal, Konbini, Link, + Multibanco, P24, Paynow, Paypal, Promptpay, + RevolutPay, SepaCreditTransfer, SepaDebit, Sofort, + Swish, UsBankAccount, WechatPay, } @@ -2058,6 +2440,7 @@ impl CreateInvoicePaymentSettingsPaymentMethodTypes { } CreateInvoicePaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", CreateInvoicePaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", + CreateInvoicePaymentSettingsPaymentMethodTypes::AmazonPay => "amazon_pay", CreateInvoicePaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", CreateInvoicePaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", CreateInvoicePaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", @@ -2072,15 +2455,18 @@ impl CreateInvoicePaymentSettingsPaymentMethodTypes { CreateInvoicePaymentSettingsPaymentMethodTypes::Ideal => "ideal", CreateInvoicePaymentSettingsPaymentMethodTypes::Konbini => "konbini", CreateInvoicePaymentSettingsPaymentMethodTypes::Link => "link", + CreateInvoicePaymentSettingsPaymentMethodTypes::Multibanco => "multibanco", CreateInvoicePaymentSettingsPaymentMethodTypes::P24 => "p24", CreateInvoicePaymentSettingsPaymentMethodTypes::Paynow => "paynow", CreateInvoicePaymentSettingsPaymentMethodTypes::Paypal => "paypal", CreateInvoicePaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", + CreateInvoicePaymentSettingsPaymentMethodTypes::RevolutPay => "revolut_pay", CreateInvoicePaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { "sepa_credit_transfer" } CreateInvoicePaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", CreateInvoicePaymentSettingsPaymentMethodTypes::Sofort => "sofort", + CreateInvoicePaymentSettingsPaymentMethodTypes::Swish => "swish", CreateInvoicePaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", CreateInvoicePaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", } @@ -2138,42 +2524,6 @@ impl std::default::Default for CreateInvoiceRenderingAmountTaxDisplay { } } -/// 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")] @@ -2534,7 +2884,6 @@ impl std::default::Default for InvoicePaymentMethodOptionsCardRequestThreeDSecur pub enum InvoicePendingInvoiceItemsBehavior { Exclude, Include, - IncludeAndRequire, } impl InvoicePendingInvoiceItemsBehavior { @@ -2542,7 +2891,6 @@ impl InvoicePendingInvoiceItemsBehavior { match self { InvoicePendingInvoiceItemsBehavior::Exclude => "exclude", InvoicePendingInvoiceItemsBehavior::Include => "include", - InvoicePendingInvoiceItemsBehavior::IncludeAndRequire => "include_and_require", } } } @@ -2647,6 +2995,7 @@ pub enum InvoicesPaymentSettingsPaymentMethodTypes { AchCreditTransfer, AchDebit, AcssDebit, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -2661,13 +3010,16 @@ pub enum InvoicesPaymentSettingsPaymentMethodTypes { Ideal, Konbini, Link, + Multibanco, P24, Paynow, Paypal, Promptpay, + RevolutPay, SepaCreditTransfer, SepaDebit, Sofort, + Swish, UsBankAccount, WechatPay, } @@ -2678,6 +3030,7 @@ impl InvoicesPaymentSettingsPaymentMethodTypes { InvoicesPaymentSettingsPaymentMethodTypes::AchCreditTransfer => "ach_credit_transfer", InvoicesPaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", InvoicesPaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", + InvoicesPaymentSettingsPaymentMethodTypes::AmazonPay => "amazon_pay", InvoicesPaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", InvoicesPaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", InvoicesPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", @@ -2692,13 +3045,16 @@ impl InvoicesPaymentSettingsPaymentMethodTypes { InvoicesPaymentSettingsPaymentMethodTypes::Ideal => "ideal", InvoicesPaymentSettingsPaymentMethodTypes::Konbini => "konbini", InvoicesPaymentSettingsPaymentMethodTypes::Link => "link", + InvoicesPaymentSettingsPaymentMethodTypes::Multibanco => "multibanco", InvoicesPaymentSettingsPaymentMethodTypes::P24 => "p24", InvoicesPaymentSettingsPaymentMethodTypes::Paynow => "paynow", InvoicesPaymentSettingsPaymentMethodTypes::Paypal => "paypal", InvoicesPaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", + InvoicesPaymentSettingsPaymentMethodTypes::RevolutPay => "revolut_pay", InvoicesPaymentSettingsPaymentMethodTypes::SepaCreditTransfer => "sepa_credit_transfer", InvoicesPaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", InvoicesPaymentSettingsPaymentMethodTypes::Sofort => "sofort", + InvoicesPaymentSettingsPaymentMethodTypes::Swish => "swish", InvoicesPaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", InvoicesPaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", } @@ -2722,6 +3078,42 @@ impl std::default::Default for InvoicesPaymentSettingsPaymentMethodTypes { } } +/// An enum representing the possible values of an `InvoicesResourcePretaxCreditAmount`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum InvoicesResourcePretaxCreditAmountType { + CreditBalanceTransaction, + Discount, +} + +impl InvoicesResourcePretaxCreditAmountType { + pub fn as_str(self) -> &'static str { + match self { + InvoicesResourcePretaxCreditAmountType::CreditBalanceTransaction => { + "credit_balance_transaction" + } + InvoicesResourcePretaxCreditAmountType::Discount => "discount", + } + } +} + +impl AsRef for InvoicesResourcePretaxCreditAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for InvoicesResourcePretaxCreditAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for InvoicesResourcePretaxCreditAmountType { + fn default() -> Self { + Self::CreditBalanceTransaction + } +} + /// 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")] @@ -2792,6 +3184,7 @@ pub enum TaxIdType { AuAbn, AuArn, BgUic, + BhVat, BoTin, BrCnpj, BrCpf, @@ -2801,11 +3194,13 @@ pub enum TaxIdType { CaPstMb, CaPstSk, CaQst, + ChUid, ChVat, ClTin, CnTin, CoNit, CrTin, + DeStn, DoRcn, EcRuc, EgTin, @@ -2815,6 +3210,7 @@ pub enum TaxIdType { GbVat, GeVat, HkBr, + HrOib, HuTin, IdNpwp, IlVat, @@ -2825,13 +3221,17 @@ pub enum TaxIdType { JpTrn, KePin, KrBrn, + KzBin, LiUid, MxRfc, MyFrp, MyItn, MySst, + NgTin, NoVat, + NoVoec, NzGst, + OmVat, PeRuc, PhTin, RoTin, @@ -2864,6 +3264,7 @@ impl TaxIdType { TaxIdType::AuAbn => "au_abn", TaxIdType::AuArn => "au_arn", TaxIdType::BgUic => "bg_uic", + TaxIdType::BhVat => "bh_vat", TaxIdType::BoTin => "bo_tin", TaxIdType::BrCnpj => "br_cnpj", TaxIdType::BrCpf => "br_cpf", @@ -2873,11 +3274,13 @@ impl TaxIdType { TaxIdType::CaPstMb => "ca_pst_mb", TaxIdType::CaPstSk => "ca_pst_sk", TaxIdType::CaQst => "ca_qst", + TaxIdType::ChUid => "ch_uid", TaxIdType::ChVat => "ch_vat", TaxIdType::ClTin => "cl_tin", TaxIdType::CnTin => "cn_tin", TaxIdType::CoNit => "co_nit", TaxIdType::CrTin => "cr_tin", + TaxIdType::DeStn => "de_stn", TaxIdType::DoRcn => "do_rcn", TaxIdType::EcRuc => "ec_ruc", TaxIdType::EgTin => "eg_tin", @@ -2887,6 +3290,7 @@ impl TaxIdType { TaxIdType::GbVat => "gb_vat", TaxIdType::GeVat => "ge_vat", TaxIdType::HkBr => "hk_br", + TaxIdType::HrOib => "hr_oib", TaxIdType::HuTin => "hu_tin", TaxIdType::IdNpwp => "id_npwp", TaxIdType::IlVat => "il_vat", @@ -2897,13 +3301,17 @@ impl TaxIdType { TaxIdType::JpTrn => "jp_trn", TaxIdType::KePin => "ke_pin", TaxIdType::KrBrn => "kr_brn", + TaxIdType::KzBin => "kz_bin", TaxIdType::LiUid => "li_uid", TaxIdType::MxRfc => "mx_rfc", TaxIdType::MyFrp => "my_frp", TaxIdType::MyItn => "my_itn", TaxIdType::MySst => "my_sst", + TaxIdType::NgTin => "ng_tin", TaxIdType::NoVat => "no_vat", + TaxIdType::NoVoec => "no_voec", TaxIdType::NzGst => "nz_gst", + TaxIdType::OmVat => "om_vat", TaxIdType::PeRuc => "pe_ruc", TaxIdType::PhTin => "ph_tin", TaxIdType::RoTin => "ro_tin", @@ -2945,3 +3353,95 @@ impl std::default::Default for TaxIdType { Self::AdNrt } } + +/// An enum representing the possible values of an `UpdateInvoiceLinesPriceData`'s `tax_behavior` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdateInvoiceLinesPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} + +impl UpdateInvoiceLinesPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + match self { + UpdateInvoiceLinesPriceDataTaxBehavior::Exclusive => "exclusive", + UpdateInvoiceLinesPriceDataTaxBehavior::Inclusive => "inclusive", + UpdateInvoiceLinesPriceDataTaxBehavior::Unspecified => "unspecified", + } + } +} + +impl AsRef for UpdateInvoiceLinesPriceDataTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdateInvoiceLinesPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdateInvoiceLinesPriceDataTaxBehavior { + fn default() -> Self { + Self::Exclusive + } +} + +/// An enum representing the possible values of an `UpdateInvoiceLinesTaxAmountsTaxRateData`'s `tax_type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType { + AmusementTax, + CommunicationsTax, + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + Vat, +} + +impl UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType { + pub fn as_str(self) -> &'static str { + match self { + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::AmusementTax => "amusement_tax", + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::CommunicationsTax => { + "communications_tax" + } + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::Gst => "gst", + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::Hst => "hst", + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::Igst => "igst", + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::Jct => "jct", + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::LeaseTax => "lease_tax", + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::Pst => "pst", + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::Qst => "qst", + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::Rst => "rst", + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::SalesTax => "sales_tax", + UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType::Vat => "vat", + } + } +} + +impl AsRef for UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdateInvoiceLinesTaxAmountsTaxRateDataTaxType { + fn default() -> Self { + Self::AmusementTax + } +} diff --git a/src/resources/generated/invoice_overdue.rs b/src/resources/generated/invoice_overdue.rs new file mode 100644 index 000000000..f4a322579 --- /dev/null +++ b/src/resources/generated/invoice_overdue.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "invoice.overdue". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct InvoiceOverdue { +} diff --git a/src/resources/generated/invoice_payment_method_options_sepa_debit.rs b/src/resources/generated/invoice_payment_method_options_sepa_debit.rs new file mode 100644 index 000000000..c7d2dead7 --- /dev/null +++ b/src/resources/generated/invoice_payment_method_options_sepa_debit.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "invoice_payment_method_options_sepa_debit". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct InvoicePaymentMethodOptionsSepaDebit { +} 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 index 5f47067a2..a717c1fd9 100644 --- a/src/resources/generated/invoice_payment_method_options_us_bank_account.rs +++ b/src/resources/generated/invoice_payment_method_options_us_bank_account.rs @@ -17,6 +17,9 @@ pub struct InvoicePaymentMethodOptionsUsBankAccount { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option, + /// The list of permissions to request. /// /// The `payment_method` permission must be included. @@ -28,11 +31,65 @@ pub struct InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions { pub prefetch: Option>, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsFilters { + /// The account subcategories to use to filter for possible accounts to link. + /// + /// Valid subcategories are `checking` and `savings`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_subcategories: Option< + Vec< + InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories, + >, + >, +} + +/// An enum representing the possible values of an `InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsFilters`'s `account_subcategories` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories { + Checking, + Savings, +} + +impl InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories { + pub fn as_str(self) -> &'static str { + match self { + InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories::Checking => "checking", + InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories::Savings => "savings", + } + } +} + +impl AsRef + for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories +{ + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display + for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default + for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories +{ + fn default() -> Self { + Self::Checking + } +} + /// 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, + Ownership, PaymentMethod, Transactions, } @@ -41,6 +98,7 @@ impl InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { pub fn as_str(self) -> &'static str { match self { InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::Balances => "balances", + InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::Ownership => "ownership", InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::PaymentMethod => "payment_method", InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::Transactions => "transactions", } @@ -71,6 +129,7 @@ impl std::default::Default #[serde(rename_all = "snake_case")] pub enum InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { Balances, + Ownership, Transactions, } @@ -80,6 +139,9 @@ impl InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch::Balances => { "balances" } + InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch::Ownership => { + "ownership" + } InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch::Transactions => { "transactions" } diff --git a/src/resources/generated/invoice_rendering_template.rs b/src/resources/generated/invoice_rendering_template.rs new file mode 100644 index 000000000..79f78248f --- /dev/null +++ b/src/resources/generated/invoice_rendering_template.rs @@ -0,0 +1,174 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::client::{Client, Response}; +use crate::ids::{InvoiceRenderingTemplateId}; +use crate::params::{Expand, List, Metadata, Object, Paginable, Timestamp}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "InvoiceRenderingTemplate". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct InvoiceRenderingTemplate { + /// Unique identifier for the object. + pub id: InvoiceRenderingTemplateId, + + /// 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, + + /// Set of [key-value pairs](https://stripe.com/docs/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 template, hidden from customers. + pub nickname: Option, + + /// The status of the template, one of `active` or `archived`. + pub status: InvoiceRenderingTemplateStatus, + + /// Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering. + pub version: i64, +} + +impl InvoiceRenderingTemplate { + + /// List all templates, ordered by creation date, with the most recently created template appearing first. +pub fn list(client: &Client, params: &ListInvoiceRenderingTemplates<'_>) -> Response> { + client.get_query("/invoice_rendering_templates", params) +} + + + /// Retrieves an invoice rendering template with the given ID. + /// + /// It by default returns the latest version of the template. + /// Optionally, specify a version to see previous versions. + pub fn retrieve(client: &Client, id: &InvoiceRenderingTemplateId, expand: &[&str]) -> Response { + client.get_query(&format!("/invoice_rendering_templates/{}", id), Expand { expand }) + } + + /// Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects (customers, invoices, etc.) can reference it. + /// + /// The template can also no longer be updated. + /// However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. + pub fn update(client: &Client, id: &InvoiceRenderingTemplateId, params: UpdateInvoiceRenderingTemplate<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] + client.post_form(&format!("/invoice_rendering_templates/{}", id), ¶ms) + } +} + +impl Object for InvoiceRenderingTemplate { + type Id = InvoiceRenderingTemplateId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "invoice_rendering_template" + } +} + +/// The parameters for `InvoiceRenderingTemplate::list`. +#[derive(Clone, Debug, Serialize, Default)] +pub struct ListInvoiceRenderingTemplates<'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, + + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl<'a> ListInvoiceRenderingTemplates<'a> { + pub fn new() -> Self { + ListInvoiceRenderingTemplates { + ending_before: Default::default(), + expand: Default::default(), + limit: Default::default(), + starting_after: Default::default(), + status: Default::default(), + } + } +} +impl Paginable for ListInvoiceRenderingTemplates<'_> { + type O = InvoiceRenderingTemplate; + fn set_last(&mut self, item: Self::O) { + self.starting_after = Some(item.id()); + }} +/// The parameters for `InvoiceRenderingTemplate::update`. +#[derive(Clone, Debug, Serialize, Default)] +pub struct UpdateInvoiceRenderingTemplate<'a> { + + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Expand::is_empty")] + pub expand: &'a [&'a str], +} + +impl<'a> UpdateInvoiceRenderingTemplate<'a> { + pub fn new() -> Self { + UpdateInvoiceRenderingTemplate { + expand: Default::default(), + } + } +} + +/// An enum representing the possible values of an `InvoiceRenderingTemplate`'s `status` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum InvoiceRenderingTemplateStatus { + Active, + Archived, +} + +impl InvoiceRenderingTemplateStatus { + pub fn as_str(self) -> &'static str { + match self { + InvoiceRenderingTemplateStatus::Active => "active", + InvoiceRenderingTemplateStatus::Archived => "archived", + } + } +} + +impl AsRef for InvoiceRenderingTemplateStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for InvoiceRenderingTemplateStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for InvoiceRenderingTemplateStatus { + fn default() -> Self { + Self::Active + } +} diff --git a/src/resources/generated/invoice_will_be_due.rs b/src/resources/generated/invoice_will_be_due.rs new file mode 100644 index 000000000..9c72b79a1 --- /dev/null +++ b/src/resources/generated/invoice_will_be_due.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "invoice.will_be_due". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct InvoiceWillBeDue { +} diff --git a/src/resources/generated/invoiceitem.rs b/src/resources/generated/invoiceitem.rs index c48a5705d..31b6cbe81 100644 --- a/src/resources/generated/invoiceitem.rs +++ b/src/resources/generated/invoiceitem.rs @@ -210,7 +210,7 @@ pub struct CreateInvoiceItem<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub discountable: Option, - /// The coupons to redeem into discounts for the invoice item or invoice line item. + /// The coupons and promotion codes to redeem into discounts for the invoice item or invoice line item. #[serde(skip_serializing_if = "Option::is_none")] pub discounts: Option>, @@ -243,10 +243,14 @@ pub struct CreateInvoiceItem<'a> { pub period: Option, /// The ID of the price 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, @@ -258,7 +262,7 @@ pub struct CreateInvoiceItem<'a> { /// 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 left blank, the invoice item is 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")] @@ -325,6 +329,7 @@ impl<'a> CreateInvoiceItem<'a> { /// The parameters for `InvoiceItem::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListInvoiceItems<'a> { + /// Only return invoice items that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, @@ -415,7 +420,7 @@ pub struct UpdateInvoiceItem<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub discountable: Option, - /// The coupons & existing discounts which apply to the invoice item or invoice line item. + /// The coupons, promotion codes & 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. @@ -443,10 +448,14 @@ pub struct UpdateInvoiceItem<'a> { pub period: Option, /// The ID of the price 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, @@ -520,6 +529,10 @@ pub struct CreateInvoiceItemDiscounts { /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -560,6 +573,10 @@ pub struct UpdateInvoiceItemDiscounts { /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, } /// An enum representing the possible values of an `InvoiceItemPriceData`'s `tax_behavior` field. diff --git a/src/resources/generated/invoices_shipping_cost.rs b/src/resources/generated/invoices_resource_shipping_cost.rs similarity index 96% rename from src/resources/generated/invoices_shipping_cost.rs rename to src/resources/generated/invoices_resource_shipping_cost.rs index c2ab9c430..256bf07ed 100644 --- a/src/resources/generated/invoices_shipping_cost.rs +++ b/src/resources/generated/invoices_resource_shipping_cost.rs @@ -2,14 +2,14 @@ // This file was automatically generated. // ====================================== -use serde::{Deserialize, Serialize}; - -use crate::params::Expandable; +use crate::params::{Expandable}; use crate::resources::{ShippingRate, TaxRate}; +use serde::{Deserialize, Serialize}; -/// The resource representing a Stripe "InvoicesShippingCost". +/// The resource representing a Stripe "InvoicesResourceShippingCost". #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesShippingCost { +pub struct InvoicesResourceShippingCost { + /// Total shipping cost before any taxes are applied. pub amount_subtotal: i64, @@ -31,6 +31,7 @@ pub struct InvoicesShippingCost { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct LineItemsTaxAmount { + /// Amount of tax applied for this rate. pub amount: i64, diff --git a/src/resources/generated/issuing_authorization.rs b/src/resources/generated/issuing_authorization.rs index 38250fa0a..ef8b23662 100644 --- a/src/resources/generated/issuing_authorization.rs +++ b/src/resources/generated/issuing_authorization.rs @@ -57,6 +57,14 @@ pub struct IssuingAuthorization { /// Must be a [supported currency](https://stripe.com/docs/currencies). pub currency: Currency, + /// Fleet-specific information for authorizations using Fleet cards. + pub fleet: Option, + + /// Information about fuel that was purchased with this transaction. + /// + /// Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. + pub fuel: 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, @@ -130,6 +138,108 @@ impl Object for IssuingAuthorization { } } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingAuthorizationFleetData { + /// Answers to prompts presented to the cardholder at the point of sale. + /// + /// Prompted fields vary depending on the configuration of your physical fleet cards. + /// Typical points of sale support only numeric entry. + pub cardholder_prompt_data: Option, + + /// The type of purchase. + pub purchase_type: Option, + + /// More information about the total amount. + /// + /// Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. + /// This information is not guaranteed to be accurate as some merchants may provide unreliable data. + pub reported_breakdown: Option, + + /// The type of fuel service. + pub service_type: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingAuthorizationFleetCardholderPromptData { + /// [Deprecated] An alphanumeric ID, though typical point of sales only support numeric entry. + /// + /// The card program can be configured to prompt for a vehicle ID, driver ID, or generic ID. + pub alphanumeric_id: Option, + + /// Driver ID. + pub driver_id: Option, + + /// Odometer reading. + pub odometer: Option, + + /// An alphanumeric ID. + /// + /// This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + pub unspecified_id: Option, + + /// User ID. + pub user_id: Option, + + /// Vehicle number. + pub vehicle_number: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingAuthorizationFleetReportedBreakdown { + /// Breakdown of fuel portion of the purchase. + pub fuel: Option, + + /// Breakdown of non-fuel portion of the purchase. + pub non_fuel: Option, + + /// Information about tax included in this transaction. + pub tax: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingAuthorizationFleetFuelPriceData { + /// Gross fuel amount that should equal Fuel Quantity multiplied by Fuel Unit Cost, inclusive of taxes. + pub gross_amount_decimal: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingAuthorizationFleetNonFuelPriceData { + /// Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + pub gross_amount_decimal: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingAuthorizationFleetTaxData { + /// Amount of state or provincial Sales Tax included in the transaction amount. + /// + /// `null` if not reported by merchant or not subject to tax. + pub local_amount_decimal: Option, + + /// Amount of national Sales Tax or VAT included in the transaction amount. + /// + /// `null` if not reported by merchant or not subject to tax. + pub national_amount_decimal: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingAuthorizationFuelData { + /// [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + pub industry_product_code: Option, + + /// The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + pub quantity_decimal: Option, + + /// The type of fuel that was purchased. + #[serde(rename = "type")] + pub type_: Option, + + /// The units for `quantity_decimal`. + pub unit: Option, + + /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + pub unit_cost_decimal: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct IssuingAuthorizationNetworkData { /// Identifier assigned to the acquirer by the card network. @@ -363,6 +473,166 @@ impl std::default::Default for IssuingAuthorizationAuthenticationExemptionType { } } +/// An enum representing the possible values of an `IssuingAuthorizationFleetData`'s `purchase_type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingAuthorizationFleetDataPurchaseType { + FuelAndNonFuelPurchase, + FuelPurchase, + NonFuelPurchase, +} + +impl IssuingAuthorizationFleetDataPurchaseType { + pub fn as_str(self) -> &'static str { + match self { + IssuingAuthorizationFleetDataPurchaseType::FuelAndNonFuelPurchase => { + "fuel_and_non_fuel_purchase" + } + IssuingAuthorizationFleetDataPurchaseType::FuelPurchase => "fuel_purchase", + IssuingAuthorizationFleetDataPurchaseType::NonFuelPurchase => "non_fuel_purchase", + } + } +} + +impl AsRef for IssuingAuthorizationFleetDataPurchaseType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingAuthorizationFleetDataPurchaseType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingAuthorizationFleetDataPurchaseType { + fn default() -> Self { + Self::FuelAndNonFuelPurchase + } +} + +/// An enum representing the possible values of an `IssuingAuthorizationFleetData`'s `service_type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingAuthorizationFleetDataServiceType { + FullService, + NonFuelTransaction, + SelfService, +} + +impl IssuingAuthorizationFleetDataServiceType { + pub fn as_str(self) -> &'static str { + match self { + IssuingAuthorizationFleetDataServiceType::FullService => "full_service", + IssuingAuthorizationFleetDataServiceType::NonFuelTransaction => "non_fuel_transaction", + IssuingAuthorizationFleetDataServiceType::SelfService => "self_service", + } + } +} + +impl AsRef for IssuingAuthorizationFleetDataServiceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingAuthorizationFleetDataServiceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingAuthorizationFleetDataServiceType { + fn default() -> Self { + Self::FullService + } +} + +/// An enum representing the possible values of an `IssuingAuthorizationFuelData`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingAuthorizationFuelDataType { + Diesel, + Other, + UnleadedPlus, + UnleadedRegular, + UnleadedSuper, +} + +impl IssuingAuthorizationFuelDataType { + pub fn as_str(self) -> &'static str { + match self { + IssuingAuthorizationFuelDataType::Diesel => "diesel", + IssuingAuthorizationFuelDataType::Other => "other", + IssuingAuthorizationFuelDataType::UnleadedPlus => "unleaded_plus", + IssuingAuthorizationFuelDataType::UnleadedRegular => "unleaded_regular", + IssuingAuthorizationFuelDataType::UnleadedSuper => "unleaded_super", + } + } +} + +impl AsRef for IssuingAuthorizationFuelDataType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingAuthorizationFuelDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingAuthorizationFuelDataType { + fn default() -> Self { + Self::Diesel + } +} + +/// An enum representing the possible values of an `IssuingAuthorizationFuelData`'s `unit` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingAuthorizationFuelDataUnit { + ChargingMinute, + ImperialGallon, + Kilogram, + KilowattHour, + Liter, + Other, + Pound, + UsGallon, +} + +impl IssuingAuthorizationFuelDataUnit { + pub fn as_str(self) -> &'static str { + match self { + IssuingAuthorizationFuelDataUnit::ChargingMinute => "charging_minute", + IssuingAuthorizationFuelDataUnit::ImperialGallon => "imperial_gallon", + IssuingAuthorizationFuelDataUnit::Kilogram => "kilogram", + IssuingAuthorizationFuelDataUnit::KilowattHour => "kilowatt_hour", + IssuingAuthorizationFuelDataUnit::Liter => "liter", + IssuingAuthorizationFuelDataUnit::Other => "other", + IssuingAuthorizationFuelDataUnit::Pound => "pound", + IssuingAuthorizationFuelDataUnit::UsGallon => "us_gallon", + } + } +} + +impl AsRef for IssuingAuthorizationFuelDataUnit { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingAuthorizationFuelDataUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingAuthorizationFuelDataUnit { + fn default() -> Self { + Self::ChargingMinute + } +} + /// 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")] diff --git a/src/resources/generated/issuing_card.rs b/src/resources/generated/issuing_card.rs index d05ad9820..2c1ce89b3 100644 --- a/src/resources/generated/issuing_card.rs +++ b/src/resources/generated/issuing_card.rs @@ -8,7 +8,7 @@ use crate::ids::IssuingCardId; use crate::params::{Expandable, Metadata, Object, Timestamp}; use crate::resources::{ Address, CardBrand, Currency, IssuingCardShippingStatus, IssuingCardShippingType, - IssuingCardType, IssuingCardholder, MerchantCategory, + IssuingCardType, IssuingCardholder, IssuingPersonalizationDesign, MerchantCategory, }; /// The resource representing a Stripe "IssuingCard". @@ -72,6 +72,9 @@ pub struct IssuingCard { #[serde(skip_serializing_if = "Option::is_none")] pub number: Option, + /// The personalization design object belonging to this card. + pub personalization_design: Option>, + /// The latest card that replaces this card, if any. pub replaced_by: Option>, @@ -118,12 +121,29 @@ pub struct IssuingCardAuthorizationControls { /// Cannot be set with `blocked_categories`. pub allowed_categories: Option>, + /// Array of strings containing representing countries from which authorizations will be allowed. + /// + /// Authorizations from merchants in all other countries will be declined. + /// Country codes should be ISO 3166 alpha-2 country codes (e.g. + /// `US`). + /// Cannot be set with `blocked_merchant_countries`. + /// Provide an empty value to unset this control. + pub allowed_merchant_countries: 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>, + /// Array of strings containing representing countries from which authorizations will be declined. + /// + /// Country codes should be ISO 3166 alpha-2 country codes (e.g. + /// `US`). + /// Cannot be set with `allowed_merchant_countries`. + /// Provide an empty value to unset this control. + pub blocked_merchant_countries: 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>, @@ -137,6 +157,9 @@ pub struct IssuingCardAuthorizationControls { pub struct IssuingCardShipping { pub address: Address, + /// Address validation details for the shipment. + pub address_validation: Option, + /// The delivery company that shipped a card. pub carrier: Option, @@ -179,6 +202,18 @@ pub struct IssuingCardShipping { pub type_: IssuingCardShippingType, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingCardShippingAddressValidation { + /// The address validation capabilities to use. + pub mode: IssuingCardShippingAddressValidationMode, + + /// The normalized shipping address. + pub normalized_address: Option
, + + /// The validation result for the shipping address. + pub result: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct IssuingCardShippingCustoms { /// A registration number used for customs in Europe. @@ -381,6 +416,82 @@ impl std::default::Default for IssuingCardReplacementReason { } } +/// An enum representing the possible values of an `IssuingCardShippingAddressValidation`'s `mode` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingCardShippingAddressValidationMode { + Disabled, + NormalizationOnly, + ValidationAndNormalization, +} + +impl IssuingCardShippingAddressValidationMode { + pub fn as_str(self) -> &'static str { + match self { + IssuingCardShippingAddressValidationMode::Disabled => "disabled", + IssuingCardShippingAddressValidationMode::NormalizationOnly => "normalization_only", + IssuingCardShippingAddressValidationMode::ValidationAndNormalization => { + "validation_and_normalization" + } + } + } +} + +impl AsRef for IssuingCardShippingAddressValidationMode { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingCardShippingAddressValidationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingCardShippingAddressValidationMode { + fn default() -> Self { + Self::Disabled + } +} + +/// An enum representing the possible values of an `IssuingCardShippingAddressValidation`'s `result` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingCardShippingAddressValidationResult { + Indeterminate, + LikelyDeliverable, + LikelyUndeliverable, +} + +impl IssuingCardShippingAddressValidationResult { + pub fn as_str(self) -> &'static str { + match self { + IssuingCardShippingAddressValidationResult::Indeterminate => "indeterminate", + IssuingCardShippingAddressValidationResult::LikelyDeliverable => "likely_deliverable", + IssuingCardShippingAddressValidationResult::LikelyUndeliverable => { + "likely_undeliverable" + } + } + } +} + +impl AsRef for IssuingCardShippingAddressValidationResult { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingCardShippingAddressValidationResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingCardShippingAddressValidationResult { + fn default() -> Self { + Self::Indeterminate + } +} + /// 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")] diff --git a/src/resources/generated/issuing_cardholder.rs b/src/resources/generated/issuing_cardholder.rs index a992b662c..38a5ec60e 100644 --- a/src/resources/generated/issuing_cardholder.rs +++ b/src/resources/generated/issuing_cardholder.rs @@ -96,12 +96,29 @@ pub struct IssuingCardholderAuthorizationControls { /// Cannot be set with `blocked_categories`. pub allowed_categories: Option>, + /// Array of strings containing representing countries from which authorizations will be allowed. + /// + /// Authorizations from merchants in all other countries will be declined. + /// Country codes should be ISO 3166 alpha-2 country codes (e.g. + /// `US`). + /// Cannot be set with `blocked_merchant_countries`. + /// Provide an empty value to unset this control. + pub allowed_merchant_countries: 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>, + /// Array of strings containing representing countries from which authorizations will be declined. + /// + /// Country codes should be ISO 3166 alpha-2 country codes (e.g. + /// `US`). + /// Cannot be set with `allowed_merchant_countries`. + /// Provide an empty value to unset this control. + pub blocked_merchant_countries: Option>, + /// Limit spending with amount-based rules that apply across this cardholder's cards. pub spending_limits: Option>, diff --git a/src/resources/generated/issuing_dispute.rs b/src/resources/generated/issuing_dispute.rs index 55b88e081..b0923792a 100644 --- a/src/resources/generated/issuing_dispute.rs +++ b/src/resources/generated/issuing_dispute.rs @@ -24,6 +24,7 @@ pub struct IssuingDispute { pub amount: i64, /// List of balance transactions associated with the dispute. + #[serde(skip_serializing_if = "Option::is_none")] pub balance_transactions: Option>, /// Time at which the object was created. @@ -39,6 +40,13 @@ pub struct IssuingDispute { /// 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 enum that describes the dispute loss outcome. + /// + /// If the dispute is not lost, this field will be absent. + /// New enum values may be added in the future, so be sure to handle unknown values. + #[serde(skip_serializing_if = "Option::is_none")] + pub loss_reason: 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. @@ -79,6 +87,9 @@ pub struct IssuingDisputeEvidence { #[serde(skip_serializing_if = "Option::is_none")] pub merchandise_not_as_described: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub no_valid_authorization: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub not_received: Option, @@ -180,6 +191,15 @@ pub struct IssuingDisputeMerchandiseNotAsDescribedEvidence { pub returned_at: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingDisputeNoValidAuthorizationEvidence { + /// (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 IssuingDisputeNotReceivedEvidence { /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. @@ -316,6 +336,7 @@ pub enum IssuingDisputeEvidenceReason { Duplicate, Fraudulent, MerchandiseNotAsDescribed, + NoValidAuthorization, NotReceived, Other, ServiceNotAsDescribed, @@ -330,6 +351,7 @@ impl IssuingDisputeEvidenceReason { IssuingDisputeEvidenceReason::MerchandiseNotAsDescribed => { "merchandise_not_as_described" } + IssuingDisputeEvidenceReason::NoValidAuthorization => "no_valid_authorization", IssuingDisputeEvidenceReason::NotReceived => "not_received", IssuingDisputeEvidenceReason::Other => "other", IssuingDisputeEvidenceReason::ServiceNotAsDescribed => "service_not_as_described", @@ -354,6 +376,97 @@ impl std::default::Default for IssuingDisputeEvidenceReason { } } +/// An enum representing the possible values of an `IssuingDispute`'s `loss_reason` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingDisputeLossReason { + CardholderAuthenticationIssuerLiability, + Eci5TokenTransactionWithTavv, + ExcessDisputesInTimeframe, + HasNotMetTheMinimumDisputeAmountRequirements, + InvalidDuplicateDispute, + InvalidIncorrectAmountDispute, + InvalidNoAuthorization, + InvalidUseOfDisputes, + MerchandiseDeliveredOrShipped, + MerchandiseOrServiceAsDescribed, + NotCancelled, + Other, + RefundIssued, + SubmittedBeyondAllowableTimeLimit, + #[serde(rename = "transaction_3ds_required")] + Transaction3dsRequired, + TransactionApprovedAfterPriorFraudDispute, + TransactionAuthorized, + TransactionElectronicallyRead, + TransactionQualifiesForVisaEasyPaymentService, + TransactionUnattended, +} + +impl IssuingDisputeLossReason { + pub fn as_str(self) -> &'static str { + match self { + IssuingDisputeLossReason::CardholderAuthenticationIssuerLiability => { + "cardholder_authentication_issuer_liability" + } + IssuingDisputeLossReason::Eci5TokenTransactionWithTavv => { + "eci5_token_transaction_with_tavv" + } + IssuingDisputeLossReason::ExcessDisputesInTimeframe => "excess_disputes_in_timeframe", + IssuingDisputeLossReason::HasNotMetTheMinimumDisputeAmountRequirements => { + "has_not_met_the_minimum_dispute_amount_requirements" + } + IssuingDisputeLossReason::InvalidDuplicateDispute => "invalid_duplicate_dispute", + IssuingDisputeLossReason::InvalidIncorrectAmountDispute => { + "invalid_incorrect_amount_dispute" + } + IssuingDisputeLossReason::InvalidNoAuthorization => "invalid_no_authorization", + IssuingDisputeLossReason::InvalidUseOfDisputes => "invalid_use_of_disputes", + IssuingDisputeLossReason::MerchandiseDeliveredOrShipped => { + "merchandise_delivered_or_shipped" + } + IssuingDisputeLossReason::MerchandiseOrServiceAsDescribed => { + "merchandise_or_service_as_described" + } + IssuingDisputeLossReason::NotCancelled => "not_cancelled", + IssuingDisputeLossReason::Other => "other", + IssuingDisputeLossReason::RefundIssued => "refund_issued", + IssuingDisputeLossReason::SubmittedBeyondAllowableTimeLimit => { + "submitted_beyond_allowable_time_limit" + } + IssuingDisputeLossReason::Transaction3dsRequired => "transaction_3ds_required", + IssuingDisputeLossReason::TransactionApprovedAfterPriorFraudDispute => { + "transaction_approved_after_prior_fraud_dispute" + } + IssuingDisputeLossReason::TransactionAuthorized => "transaction_authorized", + IssuingDisputeLossReason::TransactionElectronicallyRead => { + "transaction_electronically_read" + } + IssuingDisputeLossReason::TransactionQualifiesForVisaEasyPaymentService => { + "transaction_qualifies_for_visa_easy_payment_service" + } + IssuingDisputeLossReason::TransactionUnattended => "transaction_unattended", + } + } +} + +impl AsRef for IssuingDisputeLossReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingDisputeLossReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingDisputeLossReason { + fn default() -> Self { + Self::CardholderAuthenticationIssuerLiability + } +} + /// 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")] diff --git a/src/resources/generated/issuing_dispute_funds_rescinded.rs b/src/resources/generated/issuing_dispute_funds_rescinded.rs new file mode 100644 index 000000000..0a63c202e --- /dev/null +++ b/src/resources/generated/issuing_dispute_funds_rescinded.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "issuing_dispute.funds_rescinded". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingDisputeFundsRescinded { +} diff --git a/src/resources/generated/issuing_personalization_design.rs b/src/resources/generated/issuing_personalization_design.rs new file mode 100644 index 000000000..5f16c5502 --- /dev/null +++ b/src/resources/generated/issuing_personalization_design.rs @@ -0,0 +1,232 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{IssuingPersonalizationDesignId}; +use crate::params::{Expandable, Metadata, Object, Timestamp}; +use crate::resources::{File, IssuingPhysicalBundle}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "IssuingPersonalizationDesign". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingPersonalizationDesign { + /// Unique identifier for the object. + pub id: IssuingPersonalizationDesignId, + + /// The file for the card logo to use with physical bundles that support card logos. + /// + /// Must have a `purpose` value of `issuing_logo`. + pub card_logo: Option>, + + /// Hash containing carrier text, for use with physical bundles that support carrier text. + pub carrier_text: 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, + + /// A lookup key used to retrieve personalization designs 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: Metadata, + + /// Friendly display name. + pub name: Option, + + /// The physical bundle object belonging to this personalization design. + pub physical_bundle: Expandable, + + pub preferences: IssuingPersonalizationDesignPreferences, + + pub rejection_reasons: IssuingPersonalizationDesignRejectionReasons, + + /// Whether this personalization design can be used to create cards. + pub status: IssuingPersonalizationDesignStatus, +} + +impl Object for IssuingPersonalizationDesign { + type Id = IssuingPersonalizationDesignId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "issuing.personalization_design" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingPersonalizationDesignCarrierText { + + /// The footer body text of the carrier letter. + pub footer_body: Option, + + /// The footer title text of the carrier letter. + pub footer_title: Option, + + /// The header body text of the carrier letter. + pub header_body: Option, + + /// The header title text of the carrier letter. + pub header_title: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingPersonalizationDesignPreferences { + + /// Whether we use this personalization design to create cards when one isn't specified. + /// + /// A connected account uses the Connect platform's default design if no personalization design is set as the default design. + pub is_default: bool, + + /// Whether this personalization design is used to create cards when one is not specified and a default for this connected account does not exist. + pub is_platform_default: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingPersonalizationDesignRejectionReasons { + + /// The reason(s) the card logo was rejected. + pub card_logo: Option>, + + /// The reason(s) the carrier text was rejected. + pub carrier_text: Option>, +} + +/// An enum representing the possible values of an `IssuingPersonalizationDesignRejectionReasons`'s `card_logo` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingPersonalizationDesignRejectionReasonsCardLogo { + GeographicLocation, + Inappropriate, + NetworkName, + NonBinaryImage, + NonFiatCurrency, + Other, + OtherEntity, + PromotionalMaterial, +} + +impl IssuingPersonalizationDesignRejectionReasonsCardLogo { + pub fn as_str(self) -> &'static str { + match self { + IssuingPersonalizationDesignRejectionReasonsCardLogo::GeographicLocation => "geographic_location", + IssuingPersonalizationDesignRejectionReasonsCardLogo::Inappropriate => "inappropriate", + IssuingPersonalizationDesignRejectionReasonsCardLogo::NetworkName => "network_name", + IssuingPersonalizationDesignRejectionReasonsCardLogo::NonBinaryImage => "non_binary_image", + IssuingPersonalizationDesignRejectionReasonsCardLogo::NonFiatCurrency => "non_fiat_currency", + IssuingPersonalizationDesignRejectionReasonsCardLogo::Other => "other", + IssuingPersonalizationDesignRejectionReasonsCardLogo::OtherEntity => "other_entity", + IssuingPersonalizationDesignRejectionReasonsCardLogo::PromotionalMaterial => "promotional_material", + } + } +} + +impl AsRef for IssuingPersonalizationDesignRejectionReasonsCardLogo { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingPersonalizationDesignRejectionReasonsCardLogo { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingPersonalizationDesignRejectionReasonsCardLogo { + fn default() -> Self { + Self::GeographicLocation + } +} + +/// An enum representing the possible values of an `IssuingPersonalizationDesignRejectionReasons`'s `carrier_text` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingPersonalizationDesignRejectionReasonsCarrierText { + GeographicLocation, + Inappropriate, + NetworkName, + NonFiatCurrency, + Other, + OtherEntity, + PromotionalMaterial, +} + +impl IssuingPersonalizationDesignRejectionReasonsCarrierText { + pub fn as_str(self) -> &'static str { + match self { + IssuingPersonalizationDesignRejectionReasonsCarrierText::GeographicLocation => "geographic_location", + IssuingPersonalizationDesignRejectionReasonsCarrierText::Inappropriate => "inappropriate", + IssuingPersonalizationDesignRejectionReasonsCarrierText::NetworkName => "network_name", + IssuingPersonalizationDesignRejectionReasonsCarrierText::NonFiatCurrency => "non_fiat_currency", + IssuingPersonalizationDesignRejectionReasonsCarrierText::Other => "other", + IssuingPersonalizationDesignRejectionReasonsCarrierText::OtherEntity => "other_entity", + IssuingPersonalizationDesignRejectionReasonsCarrierText::PromotionalMaterial => "promotional_material", + } + } +} + +impl AsRef for IssuingPersonalizationDesignRejectionReasonsCarrierText { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingPersonalizationDesignRejectionReasonsCarrierText { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingPersonalizationDesignRejectionReasonsCarrierText { + fn default() -> Self { + Self::GeographicLocation + } +} + +/// An enum representing the possible values of an `IssuingPersonalizationDesign`'s `status` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingPersonalizationDesignStatus { + Active, + Inactive, + Rejected, + Review, +} + +impl IssuingPersonalizationDesignStatus { + pub fn as_str(self) -> &'static str { + match self { + IssuingPersonalizationDesignStatus::Active => "active", + IssuingPersonalizationDesignStatus::Inactive => "inactive", + IssuingPersonalizationDesignStatus::Rejected => "rejected", + IssuingPersonalizationDesignStatus::Review => "review", + } + } +} + +impl AsRef for IssuingPersonalizationDesignStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingPersonalizationDesignStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingPersonalizationDesignStatus { + fn default() -> Self { + Self::Active + } +} diff --git a/src/resources/generated/issuing_personalization_design_activated.rs b/src/resources/generated/issuing_personalization_design_activated.rs new file mode 100644 index 000000000..b2c3017d1 --- /dev/null +++ b/src/resources/generated/issuing_personalization_design_activated.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "issuing_personalization_design.activated". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingPersonalizationDesignActivated { +} diff --git a/src/resources/generated/issuing_personalization_design_deactivated.rs b/src/resources/generated/issuing_personalization_design_deactivated.rs new file mode 100644 index 000000000..8f06a4652 --- /dev/null +++ b/src/resources/generated/issuing_personalization_design_deactivated.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "issuing_personalization_design.deactivated". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingPersonalizationDesignDeactivated { +} diff --git a/src/resources/generated/issuing_personalization_design_rejected.rs b/src/resources/generated/issuing_personalization_design_rejected.rs new file mode 100644 index 000000000..8fd1589f7 --- /dev/null +++ b/src/resources/generated/issuing_personalization_design_rejected.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "issuing_personalization_design.rejected". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingPersonalizationDesignRejected { +} diff --git a/src/resources/generated/issuing_personalization_design_updated.rs b/src/resources/generated/issuing_personalization_design_updated.rs new file mode 100644 index 000000000..0210d3166 --- /dev/null +++ b/src/resources/generated/issuing_personalization_design_updated.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "issuing_personalization_design.updated". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingPersonalizationDesignUpdated { +} diff --git a/src/resources/generated/issuing_physical_bundle.rs b/src/resources/generated/issuing_physical_bundle.rs new file mode 100644 index 000000000..db874bf83 --- /dev/null +++ b/src/resources/generated/issuing_physical_bundle.rs @@ -0,0 +1,232 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{IssuingPhysicalBundleId}; +use crate::params::{Object}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "IssuingPhysicalBundle". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingPhysicalBundle { + /// Unique identifier for the object. + pub id: IssuingPhysicalBundleId, + + pub features: IssuingPhysicalBundleFeatures, + + /// 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, + + /// Friendly display name. + pub name: String, + + /// Whether this physical bundle can be used to create cards. + pub status: IssuingPhysicalBundleStatus, + + /// Whether this physical bundle is a standard Stripe offering or custom-made for you. + #[serde(rename = "type")] + pub type_: IssuingPhysicalBundleType, +} + +impl Object for IssuingPhysicalBundle { + type Id = IssuingPhysicalBundleId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "issuing.physical_bundle" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingPhysicalBundleFeatures { + + /// The policy for how to use card logo images in a card design with this physical bundle. + pub card_logo: IssuingPhysicalBundleFeaturesCardLogo, + + /// The policy for how to use carrier letter text in a card design with this physical bundle. + pub carrier_text: IssuingPhysicalBundleFeaturesCarrierText, + + /// The policy for how to use a second line on a card with this physical bundle. + pub second_line: IssuingPhysicalBundleFeaturesSecondLine, +} + +/// An enum representing the possible values of an `IssuingPhysicalBundleFeatures`'s `card_logo` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingPhysicalBundleFeaturesCardLogo { + Optional, + Required, + Unsupported, +} + +impl IssuingPhysicalBundleFeaturesCardLogo { + pub fn as_str(self) -> &'static str { + match self { + IssuingPhysicalBundleFeaturesCardLogo::Optional => "optional", + IssuingPhysicalBundleFeaturesCardLogo::Required => "required", + IssuingPhysicalBundleFeaturesCardLogo::Unsupported => "unsupported", + } + } +} + +impl AsRef for IssuingPhysicalBundleFeaturesCardLogo { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingPhysicalBundleFeaturesCardLogo { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingPhysicalBundleFeaturesCardLogo { + fn default() -> Self { + Self::Optional + } +} + +/// An enum representing the possible values of an `IssuingPhysicalBundleFeatures`'s `carrier_text` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingPhysicalBundleFeaturesCarrierText { + Optional, + Required, + Unsupported, +} + +impl IssuingPhysicalBundleFeaturesCarrierText { + pub fn as_str(self) -> &'static str { + match self { + IssuingPhysicalBundleFeaturesCarrierText::Optional => "optional", + IssuingPhysicalBundleFeaturesCarrierText::Required => "required", + IssuingPhysicalBundleFeaturesCarrierText::Unsupported => "unsupported", + } + } +} + +impl AsRef for IssuingPhysicalBundleFeaturesCarrierText { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingPhysicalBundleFeaturesCarrierText { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingPhysicalBundleFeaturesCarrierText { + fn default() -> Self { + Self::Optional + } +} + +/// An enum representing the possible values of an `IssuingPhysicalBundleFeatures`'s `second_line` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingPhysicalBundleFeaturesSecondLine { + Optional, + Required, + Unsupported, +} + +impl IssuingPhysicalBundleFeaturesSecondLine { + pub fn as_str(self) -> &'static str { + match self { + IssuingPhysicalBundleFeaturesSecondLine::Optional => "optional", + IssuingPhysicalBundleFeaturesSecondLine::Required => "required", + IssuingPhysicalBundleFeaturesSecondLine::Unsupported => "unsupported", + } + } +} + +impl AsRef for IssuingPhysicalBundleFeaturesSecondLine { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingPhysicalBundleFeaturesSecondLine { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingPhysicalBundleFeaturesSecondLine { + fn default() -> Self { + Self::Optional + } +} + +/// An enum representing the possible values of an `IssuingPhysicalBundle`'s `status` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingPhysicalBundleStatus { + Active, + Inactive, + Review, +} + +impl IssuingPhysicalBundleStatus { + pub fn as_str(self) -> &'static str { + match self { + IssuingPhysicalBundleStatus::Active => "active", + IssuingPhysicalBundleStatus::Inactive => "inactive", + IssuingPhysicalBundleStatus::Review => "review", + } + } +} + +impl AsRef for IssuingPhysicalBundleStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingPhysicalBundleStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingPhysicalBundleStatus { + fn default() -> Self { + Self::Active + } +} + +/// An enum representing the possible values of an `IssuingPhysicalBundle`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum IssuingPhysicalBundleType { + Custom, + Standard, +} + +impl IssuingPhysicalBundleType { + pub fn as_str(self) -> &'static str { + match self { + IssuingPhysicalBundleType::Custom => "custom", + IssuingPhysicalBundleType::Standard => "standard", + } + } +} + +impl AsRef for IssuingPhysicalBundleType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for IssuingPhysicalBundleType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for IssuingPhysicalBundleType { + fn default() -> Self { + Self::Custom + } +} diff --git a/src/resources/generated/issuing_transaction.rs b/src/resources/generated/issuing_transaction.rs index d22d88284..e78d1c2c3 100644 --- a/src/resources/generated/issuing_transaction.rs +++ b/src/resources/generated/issuing_transaction.rs @@ -76,6 +76,7 @@ pub struct IssuingTransaction { pub network_data: Option, /// Additional purchase information that is optionally provided by the merchant. + #[serde(skip_serializing_if = "Option::is_none")] pub purchase_details: Option, /// [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. @@ -138,6 +139,9 @@ pub struct IssuingTransactionNetworkData { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct IssuingTransactionPurchaseDetails { + /// Fleet-specific information for transactions using Fleet cards. + pub fleet: Option, + /// Information about the flight that was purchased with this transaction. pub flight: Option, @@ -154,6 +158,84 @@ pub struct IssuingTransactionPurchaseDetails { pub reference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingTransactionFleetData { + /// Answers to prompts presented to cardholder at point of sale. + pub cardholder_prompt_data: Option, + + /// The type of purchase. + /// + /// One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + pub purchase_type: Option, + + /// More information about the total amount. + /// + /// This information is not guaranteed to be accurate as some merchants may provide unreliable data. + pub reported_breakdown: Option, + + /// The type of fuel service. + /// + /// One of `non_fuel_transaction`, `full_service`, or `self_service`. + pub service_type: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingTransactionFleetCardholderPromptData { + /// Driver ID. + pub driver_id: Option, + + /// Odometer reading. + pub odometer: Option, + + /// An alphanumeric ID. + /// + /// This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + pub unspecified_id: Option, + + /// User ID. + pub user_id: Option, + + /// Vehicle number. + pub vehicle_number: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingTransactionFleetReportedBreakdown { + /// Breakdown of fuel portion of the purchase. + pub fuel: Option, + + /// Breakdown of non-fuel portion of the purchase. + pub non_fuel: Option, + + /// Information about tax included in this transaction. + pub tax: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingTransactionFleetFuelPriceData { + /// Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + pub gross_amount_decimal: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingTransactionFleetNonFuelPriceData { + /// Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + pub gross_amount_decimal: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct IssuingTransactionFleetTaxData { + /// Amount of state or provincial Sales Tax included in the transaction amount. + /// + /// Null if not reported by merchant or not subject to tax. + pub local_amount_decimal: Option, + + /// Amount of national Sales Tax or VAT included in the transaction amount. + /// + /// Null if not reported by merchant or not subject to tax. + pub national_amount_decimal: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct IssuingTransactionFlightData { /// The time that the flight departed. @@ -195,22 +277,25 @@ pub struct IssuingTransactionFlightDataLeg { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct IssuingTransactionFuelData { + /// [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + pub industry_product_code: Option, + + /// The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + pub quantity_decimal: Option, + /// 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`. + /// The units for `quantity_decimal`. /// - /// One of `us_gallon` or `liter`. + /// One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. 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)] diff --git a/src/resources/generated/item.rs b/src/resources/generated/item.rs index 5f012c684..808e9e7af 100644 --- a/src/resources/generated/item.rs +++ b/src/resources/generated/item.rs @@ -39,7 +39,8 @@ pub struct CheckoutSessionItem { /// /// Often useful for displaying to users. /// Defaults to product name. - pub description: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, /// The discounts applied to the line item. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/src/resources/generated/line_item.rs b/src/resources/generated/line_item.rs index 3c54dab60..b6e51f59f 100644 --- a/src/resources/generated/line_item.rs +++ b/src/resources/generated/line_item.rs @@ -7,7 +7,8 @@ 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, + BillingCreditBalanceTransaction, Currency, Discount, InvoiceItem, Margin, Period, Plan, Price, + Subscription, SubscriptionItem, TaxRate, }; /// The resource representing a Stripe "InvoiceLineItem". @@ -44,7 +45,10 @@ pub struct InvoiceLineItem { /// /// Line item discounts are applied before invoice discounts. /// Use `expand[]=discounts` to expand each discount. - pub discounts: Option>>, + pub discounts: Vec>, + + /// The ID of the invoice that contains this line item. + pub invoice: 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")] @@ -56,7 +60,7 @@ pub struct InvoiceLineItem { /// Set of [key-value pairs](https://stripe.com/docs/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. + /// Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation. pub metadata: Metadata, pub period: Option, @@ -64,6 +68,9 @@ pub struct InvoiceLineItem { /// The plan of the subscription, if the line item is a subscription or a proration. pub plan: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pretax_credit_amounts: Option>, + /// The price of the line item. pub price: Option, @@ -86,12 +93,10 @@ pub struct InvoiceLineItem { 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>, + pub tax_amounts: Vec, /// The tax rates which apply to the line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, + pub tax_rates: Vec, /// A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. #[serde(rename = "type")] @@ -155,6 +160,28 @@ pub struct InvoicesResourceLineItemsCreditedItems { pub invoice_line_items: Vec, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct InvoicesResourcePretaxCreditAmount { + /// The amount, in cents (or local equivalent), of the pretax credit amount. + pub amount: i64, + + /// The credit balance transaction that was applied to get this pretax credit amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_balance_transaction: Option>, + + /// The discount that was applied to get this pretax credit amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option>, + + /// The margin that was applied to get this pretax credit amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub margin: Option>, + + /// Type of the pretax credit amount referenced. + #[serde(rename = "type")] + pub type_: InvoicesResourcePretaxCreditAmountType, +} + /// 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")] @@ -190,6 +217,42 @@ impl std::default::Default for InvoiceLineItemType { } } +/// An enum representing the possible values of an `InvoicesResourcePretaxCreditAmount`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum InvoicesResourcePretaxCreditAmountType { + CreditBalanceTransaction, + Discount, +} + +impl InvoicesResourcePretaxCreditAmountType { + pub fn as_str(self) -> &'static str { + match self { + InvoicesResourcePretaxCreditAmountType::CreditBalanceTransaction => { + "credit_balance_transaction" + } + InvoicesResourcePretaxCreditAmountType::Discount => "discount", + } + } +} + +impl AsRef for InvoicesResourcePretaxCreditAmountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for InvoicesResourcePretaxCreditAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for InvoicesResourcePretaxCreditAmountType { + fn default() -> Self { + Self::CreditBalanceTransaction + } +} + /// 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")] diff --git a/src/resources/generated/linked_account_options_us_bank_account.rs b/src/resources/generated/linked_account_options_us_bank_account.rs index 890bc2468..42e562e9b 100644 --- a/src/resources/generated/linked_account_options_us_bank_account.rs +++ b/src/resources/generated/linked_account_options_us_bank_account.rs @@ -7,6 +7,9 @@ use serde::{Deserialize, Serialize}; /// The resource representing a Stripe "linked_account_options_us_bank_account". #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct LinkedAccountOptionsUsBankAccount { + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option, + /// The list of permissions to request. /// /// The `payment_method` permission must be included. @@ -23,6 +26,16 @@ pub struct LinkedAccountOptionsUsBankAccount { pub return_url: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentFlowsPrivatePaymentMethodsUsBankAccountLinkedAccountOptionsFilters { + + /// The account subcategories to use to filter for possible accounts to link. + /// + /// Valid subcategories are `checking` and `savings`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_subcategories: 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")] @@ -66,6 +79,7 @@ impl std::default::Default for LinkedAccountOptionsUsBankAccountPermissions { #[serde(rename_all = "snake_case")] pub enum LinkedAccountOptionsUsBankAccountPrefetch { Balances, + Ownership, Transactions, } @@ -73,6 +87,7 @@ impl LinkedAccountOptionsUsBankAccountPrefetch { pub fn as_str(self) -> &'static str { match self { LinkedAccountOptionsUsBankAccountPrefetch::Balances => "balances", + LinkedAccountOptionsUsBankAccountPrefetch::Ownership => "ownership", LinkedAccountOptionsUsBankAccountPrefetch::Transactions => "transactions", } } @@ -94,3 +109,38 @@ impl std::default::Default for LinkedAccountOptionsUsBankAccountPrefetch { Self::Balances } } + +/// An enum representing the possible values of an `PaymentFlowsPrivatePaymentMethodsUsBankAccountLinkedAccountOptionsFilters`'s `account_subcategories` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentFlowsPrivatePaymentMethodsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories +{ + Checking, + Savings, +} + +impl PaymentFlowsPrivatePaymentMethodsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories { + pub fn as_str(self) -> &'static str { + match self { + PaymentFlowsPrivatePaymentMethodsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories::Checking => "checking", + PaymentFlowsPrivatePaymentMethodsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories::Savings => "savings", + } + } +} + +impl AsRef for PaymentFlowsPrivatePaymentMethodsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentFlowsPrivatePaymentMethodsUsBankAccountLinkedAccountOptionsFiltersAccountSubcategories { + fn default() -> Self { + Self::Checking + } +} diff --git a/src/resources/generated/mandate.rs b/src/resources/generated/mandate.rs index 845268a65..be29ef561 100644 --- a/src/resources/generated/mandate.rs +++ b/src/resources/generated/mandate.rs @@ -86,6 +86,9 @@ pub struct MandatePaymentMethodDetails { #[serde(skip_serializing_if = "Option::is_none")] pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub au_becs_debit: Option, @@ -104,6 +107,9 @@ pub struct MandatePaymentMethodDetails { #[serde(skip_serializing_if = "Option::is_none")] pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub sepa_debit: Option, @@ -138,6 +144,9 @@ pub struct MandateAcssDebit { pub transaction_type: MandateAcssDebitTransactionType, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct MandateAmazonPay {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct MandateAuBecsDebit { /// The URL of the mandate. @@ -182,6 +191,9 @@ pub struct MandatePaypal { pub payer_id: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct MandateRevolutPay {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct MandateSepaDebit { /// The unique reference of the mandate. diff --git a/src/resources/generated/margin.rs b/src/resources/generated/margin.rs new file mode 100644 index 000000000..38ca924bf --- /dev/null +++ b/src/resources/generated/margin.rs @@ -0,0 +1,53 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{MarginId}; +use crate::params::{Metadata, Object, Timestamp}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "Margin". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct Margin { + /// Unique identifier for the object. + pub id: MarginId, + + /// Whether the margin can be applied to invoices, invoice items, or invoice line items. + /// + /// Defaults to `true`. + pub active: bool, + + /// 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, + + /// Set of [key-value pairs](https://stripe.com/docs/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 margin that's displayed on, for example, invoices. + pub name: Option, + + /// Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied. + pub percent_off: f64, + + /// Time at which the object was last updated. + /// + /// Measured in seconds since the Unix epoch. + pub updated: Timestamp, +} + +impl Object for Margin { + type Id = MarginId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "margin" + } +} diff --git a/src/resources/generated/payment_flows_private_payment_methods_alipay.rs b/src/resources/generated/payment_flows_private_payment_methods_alipay.rs new file mode 100644 index 000000000..f7c235a1f --- /dev/null +++ b/src/resources/generated/payment_flows_private_payment_methods_alipay.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "PaymentFlowsPrivatePaymentMethodsAlipay". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentFlowsPrivatePaymentMethodsAlipay { +} diff --git a/src/resources/generated/payment_intent.rs b/src/resources/generated/payment_intent.rs index 1a7baa496..2d8d30130 100644 --- a/src/resources/generated/payment_intent.rs +++ b/src/resources/generated/payment_intent.rs @@ -6,7 +6,8 @@ use serde::{Deserialize, Serialize}; use crate::client::{Client, Response}; use crate::ids::{ - CustomerId, MandateId, PaymentIntentId, PaymentMethodConfigurationId, PaymentMethodId, + ConfirmationTokenId, CustomerId, MandateId, PaymentIntentId, PaymentMethodConfigurationId, + PaymentMethodId, }; use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; use crate::resources::{ @@ -14,7 +15,8 @@ use crate::resources::{ LinkedAccountOptionsUsBankAccount, PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode, PaymentIntentOffSession, PaymentMethod, PaymentMethodConfigBizPaymentMethodConfigurationDetails, - PaymentMethodDetailsCardInstallmentsPlan, PaymentMethodOptionsCustomerBalanceEuBankAccount, + PaymentMethodDetailsCardInstallmentsPlan, PaymentMethodOptionsCardPresentRouting, + PaymentMethodOptionsCustomerBalanceEuBankAccount, PaymentMethodOptionsUsBankAccountMandateOptions, PaymentSource, Review, Shipping, }; @@ -90,7 +92,9 @@ pub struct PaymentIntent { /// /// 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. + /// If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + /// + /// If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. pub customer: Option>, /// An arbitrary string attached to the object. @@ -106,7 +110,9 @@ pub struct PaymentIntent { /// 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. + /// ID of the latest [Charge object](https://stripe.com/docs/api/charges) created by this PaymentIntent. + /// + /// This property is `null` until PaymentIntent confirmation is attempted. 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. @@ -154,9 +160,9 @@ pub struct PaymentIntent { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). pub setup_future_usage: Option, /// Shipping information for this PaymentIntent. @@ -167,16 +173,16 @@ pub struct PaymentIntent { /// 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). + /// Text that appears on the customer's statement as the statement descriptor for a non-card charge. /// - /// 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. + /// This value overrides the account's default statement descriptor. + /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). Setting this value for a card charge returns an error. + /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. pub statement_descriptor: Option, - /// Provides information about a card payment that customers see on their statements. + /// Provides information about a card charge. /// - /// 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. + /// Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. pub statement_descriptor_suffix: Option, /// Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. @@ -302,6 +308,9 @@ pub struct PaymentIntentNextAction { #[serde(skip_serializing_if = "Option::is_none")] pub konbini_display_details: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco_display_details: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub oxxo_display_details: Option, @@ -534,6 +543,21 @@ pub struct FundingInstructionsBankTransferZenginRecord { pub branch_name: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentIntentNextActionDisplayMultibancoDetails { + /// Entity number associated with this Multibanco payment. + pub entity: Option, + + /// The timestamp at which the Multibanco voucher expires. + pub expires_at: Option, + + /// The URL for the hosted Multibanco voucher page, which allows customers to view a Multibanco voucher. + pub hosted_voucher_url: Option, + + /// Reference number associated with this Multibanco payment. + pub reference: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentIntentNextActionDisplayOxxoDetails { /// The timestamp after which the OXXO voucher expires. @@ -677,30 +701,24 @@ pub struct PaymentIntentNextActionRedirectToUrl { #[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, + pub hosted_instructions_url: String, - /// The url for mobile redirect based auth. - #[serde(skip_serializing_if = "Option::is_none")] - pub mobile_auth_url: Option, + /// The url for mobile redirect based auth (for internal use only and not typically available in standard API requests). + pub mobile_auth_url: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub qr_code: Option, + pub qr_code: PaymentIntentNextActionSwishQrCode, } #[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, + pub data: String, /// The image_url_png string used to render QR code. - #[serde(skip_serializing_if = "Option::is_none")] - pub image_url_png: Option, + pub image_url_png: String, /// The image_url_svg string used to render QR code. - #[serde(skip_serializing_if = "Option::is_none")] - pub image_url_svg: Option, + pub image_url_svg: String, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -779,11 +797,14 @@ pub struct PaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub au_becs_debit: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, + pub bacs_debit: Option, #[serde(skip_serializing_if = "Option::is_none")] pub bancontact: Option, @@ -833,6 +854,12 @@ pub struct PaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub oxxo: Option, @@ -863,6 +890,9 @@ pub struct PaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub swish: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub us_bank_account: Option, @@ -880,9 +910,9 @@ pub struct PaymentIntentPaymentMethodOptionsAcssDebit { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -895,20 +925,34 @@ pub struct PaymentIntentPaymentMethodOptionsAcssDebit { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentIntentPaymentMethodOptionsBacsDebit { + #[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. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -955,7 +999,7 @@ pub struct PaymentIntentPaymentMethodOptionsCard { /// /// 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. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#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. @@ -966,9 +1010,9 @@ pub struct PaymentIntentPaymentMethodOptionsCard { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -993,9 +1037,9 @@ pub struct PaymentIntentPaymentMethodOptionsCard { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1011,9 +1055,9 @@ pub struct PaymentIntentPaymentMethodOptionsLink { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1038,6 +1082,24 @@ pub struct PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentIntentPaymentMethodOptionsMandateOptionsBacsDebit {} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentIntentPaymentMethodOptionsMobilepay { + /// 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. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentIntentPaymentMethodOptionsSepaDebit { #[serde(skip_serializing_if = "Option::is_none")] @@ -1045,9 +1107,9 @@ pub struct PaymentIntentPaymentMethodOptionsSepaDebit { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1058,14 +1120,13 @@ 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1085,9 +1146,9 @@ pub struct PaymentIntentPaymentMethodOptionsUsBankAccount { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -1136,9 +1197,9 @@ pub struct PaymentMethodOptionsAffirm { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1156,9 +1217,9 @@ pub struct PaymentMethodOptionsAfterpayClearpay { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1167,22 +1228,26 @@ pub struct PaymentMethodOptionsAfterpayClearpay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsBacsDebit { +pub struct PaymentMethodOptionsAmazonPay { + /// 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, + pub setup_future_usage: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1192,9 +1257,9 @@ pub struct PaymentMethodOptionsBancontact { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1208,9 +1273,9 @@ pub struct PaymentMethodOptionsBoleto { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1282,6 +1347,9 @@ pub struct PaymentMethodOptionsCardPresent { /// /// 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, + + #[serde(skip_serializing_if = "Option::is_none")] + pub routing: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1292,9 +1360,9 @@ pub struct PaymentMethodOptionsCashapp { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1311,9 +1379,9 @@ pub struct PaymentMethodOptionsCustomerBalance { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1339,9 +1407,9 @@ pub struct PaymentMethodOptionsCustomerBalanceBankTransfer { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1350,9 +1418,9 @@ pub struct PaymentMethodOptionsFpx { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1361,9 +1429,9 @@ pub struct PaymentMethodOptionsGiropay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1372,9 +1440,9 @@ pub struct PaymentMethodOptionsGrabpay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1393,9 +1461,9 @@ pub struct PaymentMethodOptionsKlarna { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1420,13 +1488,24 @@ pub struct PaymentMethodOptionsKonbini { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodOptionsMultibanco { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/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. @@ -1436,9 +1515,9 @@ pub struct PaymentMethodOptionsOxxo { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1447,9 +1526,9 @@ pub struct PaymentMethodOptionsOxxo { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1458,9 +1537,9 @@ pub struct PaymentMethodOptionsP24 { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1481,9 +1560,9 @@ pub struct PaymentMethodOptionsPaypal { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1498,9 +1577,9 @@ pub struct PaymentMethodOptionsPix { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1509,15 +1588,27 @@ pub struct PaymentMethodOptionsPix { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsRevolutPay {} +pub struct PaymentMethodOptionsRevolutPay { + /// 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. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodOptionsSofort { @@ -1526,13 +1617,24 @@ pub struct PaymentMethodOptionsSofort { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodOptionsTwint { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/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. @@ -1545,9 +1647,9 @@ pub struct PaymentMethodOptionsWechatPay { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1556,9 +1658,9 @@ pub struct PaymentMethodOptionsWechatPay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -1604,7 +1706,7 @@ pub struct CreatePaymentIntent<'a> { #[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. + /// Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) 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). @@ -1615,6 +1717,12 @@ pub struct CreatePaymentIntent<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub confirmation_method: Option, + /// ID of the ConfirmationToken used to confirm this PaymentIntent. + /// + /// If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_token: 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). @@ -1624,7 +1732,9 @@ pub struct CreatePaymentIntent<'a> { /// /// 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. + /// If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + /// + /// If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. #[serde(skip_serializing_if = "Option::is_none")] pub customer: Option, @@ -1728,9 +1838,9 @@ pub struct CreatePaymentIntent<'a> { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -1738,17 +1848,17 @@ pub struct CreatePaymentIntent<'a> { #[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). + /// Text that appears on the customer's statement as the statement descriptor for a non-card charge. /// - /// 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. + /// This value overrides the account's default statement descriptor. + /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). Setting this value for a card charge returns an error. + /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. #[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. + /// Provides information about a card charge. /// - /// 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. + /// Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor_suffix: Option<&'a str>, @@ -1777,6 +1887,7 @@ impl<'a> CreatePaymentIntent<'a> { capture_method: Default::default(), confirm: Default::default(), confirmation_method: Default::default(), + confirmation_token: Default::default(), currency, customer: Default::default(), description: Default::default(), @@ -1894,7 +2005,9 @@ pub struct UpdatePaymentIntent<'a> { /// /// 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. + /// If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + /// + /// If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. #[serde(skip_serializing_if = "Option::is_none")] pub customer: Option, @@ -1917,6 +2030,8 @@ pub struct UpdatePaymentIntent<'a> { 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. + /// + /// To unset this field to null, pass in an empty string. #[serde(skip_serializing_if = "Option::is_none")] pub payment_method: Option, @@ -1948,9 +2063,9 @@ pub struct UpdatePaymentIntent<'a> { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -1958,17 +2073,17 @@ pub struct UpdatePaymentIntent<'a> { #[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). + /// Text that appears on the customer's statement as the statement descriptor for a non-card charge. /// - /// 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. + /// This value overrides the account's default statement descriptor. + /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). Setting this value for a card charge returns an error. + /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. #[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. + /// Provides information about a card charge. /// - /// 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. + /// Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor_suffix: Option<&'a str>, @@ -2051,6 +2166,17 @@ pub struct CreatePaymentIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + /// This field indicates whether this payment method can be shown again to its customer in a checkout flow. + /// + /// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + /// The field defaults to `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redisplay: Option, + + /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: 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, @@ -2127,6 +2253,14 @@ pub struct CreatePaymentIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, + /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + + /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: 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, @@ -2173,6 +2307,10 @@ pub struct CreatePaymentIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub swish: Option, + /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: Option, + /// The type of the PaymentMethod. /// /// An additional hash is included on the PaymentMethod with a name matching this value. @@ -2211,6 +2349,10 @@ pub struct CreatePaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: 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, @@ -2283,6 +2425,14 @@ pub struct CreatePaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, + /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + + /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: 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, @@ -2323,6 +2473,10 @@ pub struct CreatePaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub swish: Option, + /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: 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, @@ -2404,6 +2558,17 @@ pub struct UpdatePaymentIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + /// This field indicates whether this payment method can be shown again to its customer in a checkout flow. + /// + /// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + /// The field defaults to `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redisplay: Option, + + /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: 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, @@ -2480,6 +2645,14 @@ pub struct UpdatePaymentIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, + /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + + /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: 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, @@ -2526,6 +2699,10 @@ pub struct UpdatePaymentIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub swish: Option, + /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: Option, + /// The type of the PaymentMethod. /// /// An additional hash is included on the PaymentMethod with a name matching this value. @@ -2564,6 +2741,10 @@ pub struct UpdatePaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: 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, @@ -2636,6 +2817,14 @@ pub struct UpdatePaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, + /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + + /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: 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, @@ -2676,6 +2865,10 @@ pub struct UpdatePaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub swish: Option, + /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: 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, @@ -2761,6 +2954,9 @@ pub struct CreatePaymentIntentPaymentMethodDataAfterpayClearpay {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodDataAlipay {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataAmazonPay {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodDataAuBecsDebit { /// The account number for the bank account. @@ -2866,6 +3062,12 @@ pub struct CreatePaymentIntentPaymentMethodDataKonbini {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodDataLink {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataMobilepay {} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataMultibanco {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodDataOxxo {} @@ -2913,6 +3115,9 @@ pub struct CreatePaymentIntentPaymentMethodDataSofort { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodDataSwish {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataTwint {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodDataUsBankAccount { /// Account holder type: individual or company. @@ -2953,9 +3158,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebit { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -2968,11 +3173,11 @@ pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebit { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodOptionsAffirm { - /// Controls when the funds will be captured from the customer's account. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, @@ -2982,20 +3187,20 @@ pub struct CreatePaymentIntentPaymentMethodOptionsAffirm { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, @@ -3008,9 +3213,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3020,20 +3225,40 @@ pub struct CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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 CreatePaymentIntentPaymentMethodOptionsAmazonPay { + /// Controls when the funds are captured from the customer's account. + /// + /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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 unsets 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. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + #[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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3041,11 +3266,15 @@ pub struct CreatePaymentIntentPaymentMethodOptionsAuBecsDebit { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodOptionsBacsDebit { + /// 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3060,9 +3289,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsBancontact { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3078,9 +3307,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsBlik { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3095,20 +3324,20 @@ pub struct CreatePaymentIntentPaymentMethodOptionsBoleto { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, @@ -3166,7 +3395,7 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCard { /// /// 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. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#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, @@ -3179,9 +3408,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCard { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3218,23 +3447,27 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCardPresent { /// 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, + + /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodOptionsCashapp { - /// Controls when the funds will be captured from the customer's account. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3253,9 +3486,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalance { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3265,9 +3498,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalance { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3276,9 +3509,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsEps { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3287,9 +3520,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsFpx { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3298,9 +3531,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsGiropay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3309,9 +3542,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsGrabpay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3321,11 +3554,11 @@ pub struct CreatePaymentIntentPaymentMethodOptionsInteracPresent {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodOptionsKlarna { - /// Controls when the funds will be captured from the customer's account. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, @@ -3335,9 +3568,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsKlarna { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3370,20 +3603,20 @@ pub struct CreatePaymentIntentPaymentMethodOptionsKonbini { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, @@ -3393,13 +3626,45 @@ pub struct CreatePaymentIntentPaymentMethodOptionsLink { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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 CreatePaymentIntentPaymentMethodOptionsMobilepay { + /// Controls when the funds are captured from the customer's account. + /// + /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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 unsets 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. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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 CreatePaymentIntentPaymentMethodOptionsMultibanco { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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. @@ -3410,9 +3675,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsOxxo { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3421,9 +3686,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsOxxo { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3436,9 +3701,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsP24 { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3465,9 +3730,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsPaypal { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3488,9 +3753,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsPix { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3499,9 +3764,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsPix { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3509,11 +3774,19 @@ pub struct CreatePaymentIntentPaymentMethodOptionsPromptpay { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodOptionsRevolutPay { + /// Controls when the funds are captured from the customer's account. + /// + /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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 unsets 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3527,9 +3800,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebit { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3543,9 +3816,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsSofort { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3558,13 +3831,24 @@ pub struct CreatePaymentIntentPaymentMethodOptionsSwish { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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 CreatePaymentIntentPaymentMethodOptionsTwint { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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. @@ -3587,9 +3871,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccount { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3613,9 +3897,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsWechatPay { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3625,9 +3909,9 @@ pub struct CreatePaymentIntentPaymentMethodOptionsWechatPay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -3680,6 +3964,9 @@ pub struct UpdatePaymentIntentPaymentMethodDataAfterpayClearpay {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodDataAlipay {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataAmazonPay {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodDataAuBecsDebit { /// The account number for the bank account. @@ -3785,6 +4072,12 @@ pub struct UpdatePaymentIntentPaymentMethodDataKonbini {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodDataLink {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataMobilepay {} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataMultibanco {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodDataOxxo {} @@ -3832,6 +4125,9 @@ pub struct UpdatePaymentIntentPaymentMethodDataSofort { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodDataSwish {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataTwint {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodDataUsBankAccount { /// Account holder type: individual or company. @@ -3872,9 +4168,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebit { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3887,11 +4183,11 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebit { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodOptionsAffirm { - /// Controls when the funds will be captured from the customer's account. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, @@ -3901,20 +4197,20 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsAffirm { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, @@ -3927,9 +4223,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3939,20 +4235,40 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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 UpdatePaymentIntentPaymentMethodOptionsAmazonPay { + /// Controls when the funds are captured from the customer's account. + /// + /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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 unsets 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. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + #[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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3960,11 +4276,15 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodOptionsBacsDebit { + /// 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3979,9 +4299,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsBancontact { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -3997,9 +4317,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsBlik { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4014,20 +4334,20 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsBoleto { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, @@ -4085,7 +4405,7 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCard { /// /// 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. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#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, @@ -4098,9 +4418,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCard { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -4137,23 +4457,27 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresent { /// 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, + + /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodOptionsCashapp { - /// Controls when the funds will be captured from the customer's account. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4172,9 +4496,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalance { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -4184,9 +4508,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalance { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4195,9 +4519,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsEps { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4206,9 +4530,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsFpx { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4217,9 +4541,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsGiropay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4228,9 +4552,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsGrabpay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4240,11 +4564,11 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsInteracPresent {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodOptionsKlarna { - /// Controls when the funds will be captured from the customer's account. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, @@ -4254,9 +4578,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsKlarna { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4289,20 +4613,20 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsKonbini { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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. + /// Controls when the funds are 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 provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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. + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, @@ -4312,13 +4636,45 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsLink { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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 UpdatePaymentIntentPaymentMethodOptionsMobilepay { + /// Controls when the funds are captured from the customer's account. + /// + /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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 unsets 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. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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 UpdatePaymentIntentPaymentMethodOptionsMultibanco { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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. @@ -4329,9 +4685,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsOxxo { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4340,9 +4696,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsOxxo { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -4355,9 +4711,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsP24 { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4384,9 +4740,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsPaypal { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4407,9 +4763,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsPix { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4418,9 +4774,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsPix { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -4428,11 +4784,19 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsPromptpay { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodOptionsRevolutPay { + /// Controls when the funds are captured from the customer's account. + /// + /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type 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 unsets 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -4446,9 +4810,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebit { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -4462,9 +4826,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsSofort { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4477,13 +4841,24 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsSwish { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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 UpdatePaymentIntentPaymentMethodOptionsTwint { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. + /// + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can 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. @@ -4506,9 +4881,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccount { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -4532,9 +4907,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsWechatPay { /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, @@ -4544,9 +4919,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsWechatPay { 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 you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, } @@ -4655,7 +5030,10 @@ pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallments { +pub struct CreatePaymentIntentPaymentMethodOptionsBacsDebitMandateOptions {} + +#[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. @@ -4719,6 +5097,14 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCardMandateOptions { Option>, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCardPresentRouting { + /// Routing requested priority. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested_priority: + Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure { /// The `transStatus` returned from the card Issuer’s ACS in the ARes. @@ -4794,6 +5180,11 @@ pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections { + /// Provide filters for the linked accounts that the customer can select for the payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: + Option, + /// The list of permissions to request. /// /// If this parameter is passed, the `payment_method` permission must be included. @@ -4896,6 +5287,9 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsBacsDebitMandateOptions {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallments { /// Setting to true enables installments for this PaymentIntent. @@ -4961,6 +5355,14 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions { Option>, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting { + /// Routing requested priority. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested_priority: + Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure { /// The `transStatus` returned from the card Issuer’s ACS in the ARes. @@ -5036,6 +5438,11 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections { + /// Provide filters for the linked accounts that the customer can select for the payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: + Option, + /// The list of permissions to request. /// /// If this parameter is passed, the `payment_method` permission must be included. @@ -5076,12 +5483,17 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks { #[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 required. + /// + /// It represents the number of installment payments your customer will make to their credit card. + #[serde(skip_serializing_if = "Option::is_none")] + 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: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + /// For `fixed_count` installment plans, this is required. + /// + /// It represents the interval between installment payments your customer will make to their credit card. One of `month`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, /// Type of installment plan, one of `fixed_count`. #[serde(rename = "type")] @@ -5105,14 +5517,29 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuB pub country: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters { + + /// The account subcategories to use to filter for selectable accounts. + /// + /// Valid subcategories are `checking` and `savings`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_subcategories: Option>, +} + #[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 required. + /// + /// It represents the number of installment payments your customer will make to their credit card. + #[serde(skip_serializing_if = "Option::is_none")] + 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: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + /// For `fixed_count` installment plans, this is required. + /// + /// It represents the interval between installment payments your customer will make to their credit card. One of `month`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, /// Type of installment plan, one of `fixed_count`. #[serde(rename = "type")] @@ -5136,6 +5563,16 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuB pub country: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters { + + /// The account subcategories to use to filter for selectable accounts. + /// + /// Valid subcategories are `checking` and `savings`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_subcategories: Option>, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires { @@ -5248,6 +5685,42 @@ impl std::default::Default for CreatePaymentIntentMandateDataCustomerAcceptanceT } } +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodData`'s `allow_redisplay` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentPaymentMethodDataAllowRedisplay { + Always, + Limited, + Unspecified, +} + +impl CreatePaymentIntentPaymentMethodDataAllowRedisplay { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentPaymentMethodDataAllowRedisplay::Always => "always", + CreatePaymentIntentPaymentMethodDataAllowRedisplay::Limited => "limited", + CreatePaymentIntentPaymentMethodDataAllowRedisplay::Unspecified => "unspecified", + } + } +} + +impl AsRef for CreatePaymentIntentPaymentMethodDataAllowRedisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataAllowRedisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentPaymentMethodDataAllowRedisplay { + fn default() -> Self { + Self::Always + } +} + /// 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")] @@ -5676,6 +6149,7 @@ pub enum CreatePaymentIntentPaymentMethodDataType { Affirm, AfterpayClearpay, Alipay, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -5691,6 +6165,8 @@ pub enum CreatePaymentIntentPaymentMethodDataType { Klarna, Konbini, Link, + Mobilepay, + Multibanco, Oxxo, P24, Paynow, @@ -5701,6 +6177,7 @@ pub enum CreatePaymentIntentPaymentMethodDataType { SepaDebit, Sofort, Swish, + Twint, UsBankAccount, WechatPay, Zip, @@ -5713,6 +6190,7 @@ impl CreatePaymentIntentPaymentMethodDataType { CreatePaymentIntentPaymentMethodDataType::Affirm => "affirm", CreatePaymentIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", CreatePaymentIntentPaymentMethodDataType::Alipay => "alipay", + CreatePaymentIntentPaymentMethodDataType::AmazonPay => "amazon_pay", CreatePaymentIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", CreatePaymentIntentPaymentMethodDataType::BacsDebit => "bacs_debit", CreatePaymentIntentPaymentMethodDataType::Bancontact => "bancontact", @@ -5728,6 +6206,8 @@ impl CreatePaymentIntentPaymentMethodDataType { CreatePaymentIntentPaymentMethodDataType::Klarna => "klarna", CreatePaymentIntentPaymentMethodDataType::Konbini => "konbini", CreatePaymentIntentPaymentMethodDataType::Link => "link", + CreatePaymentIntentPaymentMethodDataType::Mobilepay => "mobilepay", + CreatePaymentIntentPaymentMethodDataType::Multibanco => "multibanco", CreatePaymentIntentPaymentMethodDataType::Oxxo => "oxxo", CreatePaymentIntentPaymentMethodDataType::P24 => "p24", CreatePaymentIntentPaymentMethodDataType::Paynow => "paynow", @@ -5738,6 +6218,7 @@ impl CreatePaymentIntentPaymentMethodDataType { CreatePaymentIntentPaymentMethodDataType::SepaDebit => "sepa_debit", CreatePaymentIntentPaymentMethodDataType::Sofort => "sofort", CreatePaymentIntentPaymentMethodDataType::Swish => "swish", + CreatePaymentIntentPaymentMethodDataType::Twint => "twint", CreatePaymentIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", CreatePaymentIntentPaymentMethodDataType::WechatPay => "wechat_pay", CreatePaymentIntentPaymentMethodDataType::Zip => "zip", @@ -6164,6 +6645,74 @@ impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAlipaySetu } } +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAmazonPay`'s `capture_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod { + Manual, +} + +impl CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAmazonPay`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage { + None, + OffSession, +} + +impl CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::None => "none", + CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::OffSession => { + "off_session" + } + } + } +} + +impl AsRef for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage { + 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")] @@ -6611,6 +7160,7 @@ pub enum CreatePaymentIntentPaymentMethodOptionsCardNetwork { Diners, Discover, EftposAu, + Girocard, Interac, Jcb, Mastercard, @@ -6629,6 +7179,7 @@ impl CreatePaymentIntentPaymentMethodOptionsCardNetwork { CreatePaymentIntentPaymentMethodOptionsCardNetwork::Diners => "diners", CreatePaymentIntentPaymentMethodOptionsCardNetwork::Discover => "discover", CreatePaymentIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", + CreatePaymentIntentPaymentMethodOptionsCardNetwork::Girocard => "girocard", CreatePaymentIntentPaymentMethodOptionsCardNetwork::Interac => "interac", CreatePaymentIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", CreatePaymentIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", @@ -6656,6 +7207,44 @@ impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardNetwor } } +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardPresentRouting`'s `requested_priority` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority { + Domestic, + International, +} + +impl CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::Domestic => "domestic", + CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::International => "international", + } + } +} + +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default + for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority +{ + fn default() -> Self { + Self::Domestic + } +} + /// 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")] @@ -7604,6 +8193,8 @@ pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { EnPl, #[serde(rename = "en-PT")] EnPt, + #[serde(rename = "en-RO")] + EnRo, #[serde(rename = "en-SE")] EnSe, #[serde(rename = "en-US")] @@ -7636,6 +8227,8 @@ pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { PlPl, #[serde(rename = "pt-PT")] PtPt, + #[serde(rename = "ro-RO")] + RoRo, #[serde(rename = "sv-FI")] SvFi, #[serde(rename = "sv-SE")] @@ -7671,6 +8264,7 @@ impl CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNz => "en-NZ", CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPl => "en-PL", CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPt => "en-PT", + CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnRo => "en-RO", CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnSe => "en-SE", CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnUs => "en-US", CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EsEs => "es-ES", @@ -7687,6 +8281,7 @@ impl CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NlNl => "nl-NL", CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PlPl => "pl-PL", CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PtPt => "pt-PT", + CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::RoRo => "ro-RO", CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvFi => "sv-FI", CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvSe => "sv-SE", } @@ -7842,6 +8437,102 @@ impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsLinkSetupF } } +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsMobilepay`'s `capture_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + Manual, +} + +impl CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsMobilepay`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + None, +} + +impl CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::None => "none", + } + } +} + +impl AsRef for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + fn default() -> Self { + Self::None + } +} + +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsMultibanco`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage { + None, +} + +impl CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::None => "none", + } + } +} + +impl AsRef for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage { + 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")] @@ -8163,6 +8854,38 @@ impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPromptpayS } } +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsRevolutPay`'s `capture_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod { + Manual, +} + +impl CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + /// 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")] @@ -8351,29 +9074,96 @@ impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsSwishSetup } } -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsTwint`'s `setup_future_usage` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, +pub enum CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage { + None, } -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { +impl CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage { pub fn as_str(self) -> &'static str { match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", + CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::None => "none", } } } -impl AsRef - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +impl AsRef for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage { + fn default() -> Self { + Self::None + } +} + +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`'s `account_subcategories` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories +{ + Checking, + Savings, +} + +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Checking => "checking", + CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Savings => "savings", + } + } +} + +impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn default() -> Self { + Self::Checking + } +} + +/// 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() @@ -8400,6 +9190,7 @@ impl std::default::Default #[serde(rename_all = "snake_case")] pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { Balances, + Ownership, Transactions, } @@ -8407,6 +9198,7 @@ impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPre pub fn as_str(self) -> &'static str { match self { CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", + CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Ownership => "ownership", CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", } } @@ -9163,6 +9955,42 @@ impl std::default::Default for PaymentIntentPaymentMethodOptionsAuBecsDebitSetup } } +/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsBacsDebit`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} + +impl PaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + PaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::None => "none", + PaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::OffSession => "off_session", + PaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::OnSession => "on_session", + } + } +} + +impl AsRef for PaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + 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")] @@ -9236,6 +10064,7 @@ pub enum PaymentIntentPaymentMethodOptionsCardNetwork { Diners, Discover, EftposAu, + Girocard, Interac, Jcb, Mastercard, @@ -9252,6 +10081,7 @@ impl PaymentIntentPaymentMethodOptionsCardNetwork { PaymentIntentPaymentMethodOptionsCardNetwork::Diners => "diners", PaymentIntentPaymentMethodOptionsCardNetwork::Discover => "discover", PaymentIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", + PaymentIntentPaymentMethodOptionsCardNetwork::Girocard => "girocard", PaymentIntentPaymentMethodOptionsCardNetwork::Interac => "interac", PaymentIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", PaymentIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", @@ -9675,6 +10505,70 @@ impl std::default::Default } } +/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsMobilepay`'s `capture_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + Manual, +} + +impl PaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + PaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for PaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + +/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsMobilepay`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + None, +} + +impl PaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + PaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::None => "none", + } + } +} + +impl AsRef for PaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + fn default() -> Self { + Self::None + } +} + /// 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")] @@ -10169,37 +11063,67 @@ impl std::default::Default for PaymentMethodOptionsAlipaySetupFutureUsage { } } -/// An enum representing the possible values of an `PaymentMethodOptionsBacsDebit`'s `setup_future_usage` field. +/// An enum representing the possible values of an `PaymentMethodOptionsAmazonPay`'s `capture_method` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsBacsDebitSetupFutureUsage { +pub enum PaymentMethodOptionsAmazonPayCaptureMethod { + Manual, +} + +impl PaymentMethodOptionsAmazonPayCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + PaymentMethodOptionsAmazonPayCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for PaymentMethodOptionsAmazonPayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentMethodOptionsAmazonPayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentMethodOptionsAmazonPayCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + +/// An enum representing the possible values of an `PaymentMethodOptionsAmazonPay`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentMethodOptionsAmazonPaySetupFutureUsage { None, OffSession, - OnSession, } -impl PaymentMethodOptionsBacsDebitSetupFutureUsage { +impl PaymentMethodOptionsAmazonPaySetupFutureUsage { pub fn as_str(self) -> &'static str { match self { - PaymentMethodOptionsBacsDebitSetupFutureUsage::None => "none", - PaymentMethodOptionsBacsDebitSetupFutureUsage::OffSession => "off_session", - PaymentMethodOptionsBacsDebitSetupFutureUsage::OnSession => "on_session", + PaymentMethodOptionsAmazonPaySetupFutureUsage::None => "none", + PaymentMethodOptionsAmazonPaySetupFutureUsage::OffSession => "off_session", } } } -impl AsRef for PaymentMethodOptionsBacsDebitSetupFutureUsage { +impl AsRef for PaymentMethodOptionsAmazonPaySetupFutureUsage { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for PaymentMethodOptionsBacsDebitSetupFutureUsage { +impl std::fmt::Display for PaymentMethodOptionsAmazonPaySetupFutureUsage { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { self.as_str().fmt(f) } } -impl std::default::Default for PaymentMethodOptionsBacsDebitSetupFutureUsage { +impl std::default::Default for PaymentMethodOptionsAmazonPaySetupFutureUsage { fn default() -> Self { Self::None } @@ -10877,6 +11801,38 @@ impl std::default::Default for PaymentMethodOptionsKonbiniSetupFutureUsage { } } +/// An enum representing the possible values of an `PaymentMethodOptionsMultibanco`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentMethodOptionsMultibancoSetupFutureUsage { + None, +} + +impl PaymentMethodOptionsMultibancoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + PaymentMethodOptionsMultibancoSetupFutureUsage::None => "none", + } + } +} + +impl AsRef for PaymentMethodOptionsMultibancoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentMethodOptionsMultibancoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentMethodOptionsMultibancoSetupFutureUsage { + 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")] @@ -11103,6 +12059,72 @@ impl std::default::Default for PaymentMethodOptionsPromptpaySetupFutureUsage { } } +/// An enum representing the possible values of an `PaymentMethodOptionsRevolutPay`'s `capture_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentMethodOptionsRevolutPayCaptureMethod { + Manual, +} + +impl PaymentMethodOptionsRevolutPayCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + PaymentMethodOptionsRevolutPayCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for PaymentMethodOptionsRevolutPayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentMethodOptionsRevolutPayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentMethodOptionsRevolutPayCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + +/// An enum representing the possible values of an `PaymentMethodOptionsRevolutPay`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentMethodOptionsRevolutPaySetupFutureUsage { + None, + OffSession, +} + +impl PaymentMethodOptionsRevolutPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + PaymentMethodOptionsRevolutPaySetupFutureUsage::None => "none", + PaymentMethodOptionsRevolutPaySetupFutureUsage::OffSession => "off_session", + } + } +} + +impl AsRef for PaymentMethodOptionsRevolutPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentMethodOptionsRevolutPaySetupFutureUsage { + 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")] @@ -11181,6 +12203,38 @@ impl std::default::Default for PaymentMethodOptionsSofortSetupFutureUsage { } } +/// An enum representing the possible values of an `PaymentMethodOptionsTwint`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentMethodOptionsTwintSetupFutureUsage { + None, +} + +impl PaymentMethodOptionsTwintSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + PaymentMethodOptionsTwintSetupFutureUsage::None => "none", + } + } +} + +impl AsRef for PaymentMethodOptionsTwintSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentMethodOptionsTwintSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentMethodOptionsTwintSetupFutureUsage { + 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")] @@ -11220,64 +12274,100 @@ impl std::default::Default for PaymentMethodOptionsWechatPayClient { /// 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 { +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 PaymentMethodOptionsWechatPaySetupFutureUsage { +impl PaymentMethodOptionsZipSetupFutureUsage { pub fn as_str(self) -> &'static str { match self { - PaymentMethodOptionsWechatPaySetupFutureUsage::None => "none", + PaymentMethodOptionsZipSetupFutureUsage::None => "none", } } } -impl AsRef for PaymentMethodOptionsWechatPaySetupFutureUsage { +impl AsRef for PaymentMethodOptionsZipSetupFutureUsage { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for PaymentMethodOptionsWechatPaySetupFutureUsage { +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 PaymentMethodOptionsWechatPaySetupFutureUsage { +impl std::default::Default for PaymentMethodOptionsZipSetupFutureUsage { fn default() -> Self { Self::None } } -/// An enum representing the possible values of an `PaymentMethodOptionsZip`'s `setup_future_usage` field. +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodData`'s `allow_redisplay` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsZipSetupFutureUsage { - None, +pub enum UpdatePaymentIntentPaymentMethodDataAllowRedisplay { + Always, + Limited, + Unspecified, } -impl PaymentMethodOptionsZipSetupFutureUsage { +impl UpdatePaymentIntentPaymentMethodDataAllowRedisplay { pub fn as_str(self) -> &'static str { match self { - PaymentMethodOptionsZipSetupFutureUsage::None => "none", + UpdatePaymentIntentPaymentMethodDataAllowRedisplay::Always => "always", + UpdatePaymentIntentPaymentMethodDataAllowRedisplay::Limited => "limited", + UpdatePaymentIntentPaymentMethodDataAllowRedisplay::Unspecified => "unspecified", } } } -impl AsRef for PaymentMethodOptionsZipSetupFutureUsage { +impl AsRef for UpdatePaymentIntentPaymentMethodDataAllowRedisplay { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for PaymentMethodOptionsZipSetupFutureUsage { +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataAllowRedisplay { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { self.as_str().fmt(f) } } -impl std::default::Default for PaymentMethodOptionsZipSetupFutureUsage { +impl std::default::Default for UpdatePaymentIntentPaymentMethodDataAllowRedisplay { fn default() -> Self { - Self::None + Self::Always } } @@ -11709,6 +12799,7 @@ pub enum UpdatePaymentIntentPaymentMethodDataType { Affirm, AfterpayClearpay, Alipay, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -11724,6 +12815,8 @@ pub enum UpdatePaymentIntentPaymentMethodDataType { Klarna, Konbini, Link, + Mobilepay, + Multibanco, Oxxo, P24, Paynow, @@ -11734,6 +12827,7 @@ pub enum UpdatePaymentIntentPaymentMethodDataType { SepaDebit, Sofort, Swish, + Twint, UsBankAccount, WechatPay, Zip, @@ -11746,6 +12840,7 @@ impl UpdatePaymentIntentPaymentMethodDataType { UpdatePaymentIntentPaymentMethodDataType::Affirm => "affirm", UpdatePaymentIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", UpdatePaymentIntentPaymentMethodDataType::Alipay => "alipay", + UpdatePaymentIntentPaymentMethodDataType::AmazonPay => "amazon_pay", UpdatePaymentIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", UpdatePaymentIntentPaymentMethodDataType::BacsDebit => "bacs_debit", UpdatePaymentIntentPaymentMethodDataType::Bancontact => "bancontact", @@ -11761,6 +12856,8 @@ impl UpdatePaymentIntentPaymentMethodDataType { UpdatePaymentIntentPaymentMethodDataType::Klarna => "klarna", UpdatePaymentIntentPaymentMethodDataType::Konbini => "konbini", UpdatePaymentIntentPaymentMethodDataType::Link => "link", + UpdatePaymentIntentPaymentMethodDataType::Mobilepay => "mobilepay", + UpdatePaymentIntentPaymentMethodDataType::Multibanco => "multibanco", UpdatePaymentIntentPaymentMethodDataType::Oxxo => "oxxo", UpdatePaymentIntentPaymentMethodDataType::P24 => "p24", UpdatePaymentIntentPaymentMethodDataType::Paynow => "paynow", @@ -11771,6 +12868,7 @@ impl UpdatePaymentIntentPaymentMethodDataType { UpdatePaymentIntentPaymentMethodDataType::SepaDebit => "sepa_debit", UpdatePaymentIntentPaymentMethodDataType::Sofort => "sofort", UpdatePaymentIntentPaymentMethodDataType::Swish => "swish", + UpdatePaymentIntentPaymentMethodDataType::Twint => "twint", UpdatePaymentIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", UpdatePaymentIntentPaymentMethodDataType::WechatPay => "wechat_pay", UpdatePaymentIntentPaymentMethodDataType::Zip => "zip", @@ -12197,6 +13295,74 @@ impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAlipaySetu } } +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAmazonPay`'s `capture_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod { + Manual, +} + +impl UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAmazonPay`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage { + None, + OffSession, +} + +impl UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::None => "none", + UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::OffSession => { + "off_session" + } + } + } +} + +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage { + 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")] @@ -12644,6 +13810,7 @@ pub enum UpdatePaymentIntentPaymentMethodOptionsCardNetwork { Diners, Discover, EftposAu, + Girocard, Interac, Jcb, Mastercard, @@ -12662,6 +13829,7 @@ impl UpdatePaymentIntentPaymentMethodOptionsCardNetwork { UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Diners => "diners", UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Discover => "discover", UpdatePaymentIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", + UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Girocard => "girocard", UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Interac => "interac", UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", @@ -12689,6 +13857,44 @@ impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardNetwor } } +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting`'s `requested_priority` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority { + Domestic, + International, +} + +impl UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::Domestic => "domestic", + UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::International => "international", + } + } +} + +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default + for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority +{ + fn default() -> Self { + Self::Domestic + } +} + /// 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")] @@ -13637,6 +14843,8 @@ pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { EnPl, #[serde(rename = "en-PT")] EnPt, + #[serde(rename = "en-RO")] + EnRo, #[serde(rename = "en-SE")] EnSe, #[serde(rename = "en-US")] @@ -13669,6 +14877,8 @@ pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { PlPl, #[serde(rename = "pt-PT")] PtPt, + #[serde(rename = "ro-RO")] + RoRo, #[serde(rename = "sv-FI")] SvFi, #[serde(rename = "sv-SE")] @@ -13704,6 +14914,7 @@ impl UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNz => "en-NZ", UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPl => "en-PL", UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPt => "en-PT", + UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnRo => "en-RO", UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnSe => "en-SE", UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnUs => "en-US", UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EsEs => "es-ES", @@ -13720,6 +14931,7 @@ impl UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NlNl => "nl-NL", UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PlPl => "pl-PL", UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PtPt => "pt-PT", + UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::RoRo => "ro-RO", UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvFi => "sv-FI", UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvSe => "sv-SE", } @@ -13875,6 +15087,102 @@ impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsLinkSetupF } } +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsMobilepay`'s `capture_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + Manual, +} + +impl UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsMobilepay`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + None, +} + +impl UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::None => "none", + } + } +} + +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage { + fn default() -> Self { + Self::None + } +} + +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsMultibanco`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage { + None, +} + +impl UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::None => "none", + } + } +} + +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage { + 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")] @@ -14196,6 +15504,38 @@ impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPromptpayS } } +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsRevolutPay`'s `capture_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod { + Manual, +} + +impl UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + /// 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")] @@ -14384,6 +15724,73 @@ impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsSwishSetup } } +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsTwint`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage { + None, +} + +impl UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::None => "none", + } + } +} + +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage { + fn default() -> Self { + Self::None + } +} + +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`'s `account_subcategories` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories +{ + Checking, + Savings, +} + +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Checking => "checking", + UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Savings => "savings", + } + } +} + +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn default() -> Self { + Self::Checking + } +} + /// 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")] @@ -14433,6 +15840,7 @@ impl std::default::Default #[serde(rename_all = "snake_case")] pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { Balances, + Ownership, Transactions, } @@ -14440,6 +15848,7 @@ impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPre pub fn as_str(self) -> &'static str { match self { UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", + UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Ownership => "ownership", UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", } } diff --git a/src/resources/generated/payment_link.rs b/src/resources/generated/payment_link.rs index 6254eb07a..be96e7a2f 100644 --- a/src/resources/generated/payment_link.rs +++ b/src/resources/generated/payment_link.rs @@ -42,6 +42,8 @@ pub struct PaymentLink { pub automatic_tax: PaymentLinksResourceAutomaticTax, /// Configuration for collecting the customer's billing address. + /// + /// Defaults to `auto`. pub billing_address_collection: PaymentLinkBillingAddressCollection, /// When set, provides configuration to gather active consent from customers. @@ -89,6 +91,8 @@ pub struct PaymentLink { pub payment_intent_data: Option, /// Configuration for collecting a payment method during checkout. + /// + /// Defaults to `always`. pub payment_method_collection: PaymentLinkPaymentMethodCollection, /// The list of payment method types that customers can use. @@ -379,15 +383,12 @@ pub struct PaymentLinksResourcePaymentIntentData { /// 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. + /// For a non-card payment, information about the charge that appears on the 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. + /// For a card payment, information about the charge that appears on the customer's statement when this payment succeeds in creating a charge. /// - /// 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. + /// Concatenated with the account's statement descriptor prefix to form the complete statement descriptor. pub statement_descriptor_suffix: Option, /// A string that identifies the resulting payment as part of a group. @@ -469,6 +470,8 @@ pub struct PaymentLinksResourceSubscriptionDataInvoiceSettings { pub struct PaymentLinksResourceTaxIdCollection { /// Indicates whether tax ID collection is enabled for the session. pub enabled: bool, + + pub required: PaymentLinksResourceTaxIdCollectionRequired, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -511,6 +514,8 @@ pub struct CreatePaymentLink<'a> { pub automatic_tax: Option, /// Configuration for collecting the customer's billing address. + /// + /// Defaults to `auto`. #[serde(skip_serializing_if = "Option::is_none")] pub billing_address_collection: Option, @@ -575,7 +580,8 @@ pub struct CreatePaymentLink<'a> { /// 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). + /// 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. + /// Defaults to `always`. 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, @@ -730,6 +736,8 @@ pub struct UpdatePaymentLink<'a> { pub automatic_tax: Option, /// Configuration for collecting the customer's billing address. + /// + /// Defaults to `auto`. #[serde(skip_serializing_if = "Option::is_none")] pub billing_address_collection: Option, @@ -781,7 +789,8 @@ pub struct UpdatePaymentLink<'a> { /// 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). + /// 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. + /// Defaults to `always`. 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, @@ -804,6 +813,10 @@ pub struct UpdatePaymentLink<'a> { /// 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, } impl<'a> UpdatePaymentLink<'a> { @@ -828,6 +841,7 @@ impl<'a> UpdatePaymentLink<'a> { restrictions: Default::default(), shipping_address_collection: Default::default(), subscription_data: Default::default(), + tax_id_collection: Default::default(), } } } @@ -992,16 +1006,17 @@ pub struct CreatePaymentLinkPaymentIntentData { #[serde(skip_serializing_if = "Option::is_none")] pub setup_future_usage: Option, - /// Extra information about the payment. + /// Text that appears on the customer's statement as the statement descriptor for a non-card charge. /// - /// This will appear on your customer's statement when this payment succeeds in creating a charge. + /// This value overrides the account's default statement descriptor. + /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). Setting this value for a card charge returns an error. + /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor: Option, - /// Provides information about the charge that customers see on their statements. + /// Provides information about a card charge. /// - /// 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. + /// Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor_suffix: Option, @@ -1072,8 +1087,16 @@ pub struct CreatePaymentLinkSubscriptionData { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentLinkTaxIdCollection { - /// Set to `true` to enable tax ID collection. + /// Enable tax ID collection during checkout. + /// + /// Defaults to `false`. pub enabled: bool, + + /// Describes whether a tax ID is required during checkout. + /// + /// Defaults to `never`. + #[serde(skip_serializing_if = "Option::is_none")] + pub required: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1211,16 +1234,17 @@ pub struct UpdatePaymentLinkPaymentIntentData { #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, - /// Extra information about the payment. + /// Text that appears on the customer's statement as the statement descriptor for a non-card charge. /// - /// This will appear on your customer's statement when this payment succeeds in creating a charge. + /// This value overrides the account's default statement descriptor. + /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). Setting this value for a card charge returns an error. + /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor: Option, - /// Provides information about the charge that customers see on their statements. + /// Provides information about a card charge. /// - /// 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. + /// Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor_suffix: Option, @@ -1264,6 +1288,20 @@ pub struct UpdatePaymentLinkSubscriptionData { pub trial_settings: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentLinkTaxIdCollection { + /// Enable tax ID collection during checkout. + /// + /// Defaults to `false`. + pub enabled: bool, + + /// Describes whether a tax ID is required during checkout. + /// + /// Defaults to `never`. + #[serde(skip_serializing_if = "Option::is_none")] + pub required: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentLinkAfterCompletionHostedConfirmation { /// A custom message to display to the customer after the purchase is complete. @@ -1634,12 +1672,12 @@ pub struct CreatePaymentLinkCustomFieldsDropdownOptions { pub struct CreatePaymentLinkInvoiceCreationInvoiceDataCustomFields { /// The name of the custom field. /// - /// This may be up to 30 characters. + /// This may be up to 40 characters. pub name: String, /// The value of the custom field. /// - /// This may be up to 30 characters. + /// This may be up to 140 characters. pub value: String, } @@ -1701,12 +1739,12 @@ pub struct UpdatePaymentLinkCustomFieldsDropdownOptions { pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataCustomFields { /// The name of the custom field. /// - /// This may be up to 30 characters. + /// This may be up to 40 characters. pub name: String, /// The value of the custom field. /// - /// This may be up to 30 characters. + /// This may be up to 140 characters. pub value: String, } @@ -2159,6 +2197,8 @@ pub enum CreatePaymentLinkPaymentMethodTypes { Klarna, Konbini, Link, + Mobilepay, + Multibanco, Oxxo, P24, Paynow, @@ -2168,8 +2208,10 @@ pub enum CreatePaymentLinkPaymentMethodTypes { SepaDebit, Sofort, Swish, + Twint, UsBankAccount, WechatPay, + Zip, } impl CreatePaymentLinkPaymentMethodTypes { @@ -2193,6 +2235,8 @@ impl CreatePaymentLinkPaymentMethodTypes { CreatePaymentLinkPaymentMethodTypes::Klarna => "klarna", CreatePaymentLinkPaymentMethodTypes::Konbini => "konbini", CreatePaymentLinkPaymentMethodTypes::Link => "link", + CreatePaymentLinkPaymentMethodTypes::Mobilepay => "mobilepay", + CreatePaymentLinkPaymentMethodTypes::Multibanco => "multibanco", CreatePaymentLinkPaymentMethodTypes::Oxxo => "oxxo", CreatePaymentLinkPaymentMethodTypes::P24 => "p24", CreatePaymentLinkPaymentMethodTypes::Paynow => "paynow", @@ -2202,8 +2246,10 @@ impl CreatePaymentLinkPaymentMethodTypes { CreatePaymentLinkPaymentMethodTypes::SepaDebit => "sepa_debit", CreatePaymentLinkPaymentMethodTypes::Sofort => "sofort", CreatePaymentLinkPaymentMethodTypes::Swish => "swish", + CreatePaymentLinkPaymentMethodTypes::Twint => "twint", CreatePaymentLinkPaymentMethodTypes::UsBankAccount => "us_bank_account", CreatePaymentLinkPaymentMethodTypes::WechatPay => "wechat_pay", + CreatePaymentLinkPaymentMethodTypes::Zip => "zip", } } } @@ -3041,6 +3087,40 @@ impl std::default::Default } } +/// An enum representing the possible values of an `CreatePaymentLinkTaxIdCollection`'s `required` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentLinkTaxIdCollectionRequired { + IfSupported, + Never, +} + +impl CreatePaymentLinkTaxIdCollectionRequired { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentLinkTaxIdCollectionRequired::IfSupported => "if_supported", + CreatePaymentLinkTaxIdCollectionRequired::Never => "never", + } + } +} + +impl AsRef for CreatePaymentLinkTaxIdCollectionRequired { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentLinkTaxIdCollectionRequired { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentLinkTaxIdCollectionRequired { + fn default() -> Self { + Self::IfSupported + } +} + /// 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")] @@ -3165,6 +3245,8 @@ pub enum PaymentLinkPaymentMethodTypes { Klarna, Konbini, Link, + Mobilepay, + Multibanco, Oxxo, P24, Paynow, @@ -3174,8 +3256,10 @@ pub enum PaymentLinkPaymentMethodTypes { SepaDebit, Sofort, Swish, + Twint, UsBankAccount, WechatPay, + Zip, } impl PaymentLinkPaymentMethodTypes { @@ -3199,6 +3283,8 @@ impl PaymentLinkPaymentMethodTypes { PaymentLinkPaymentMethodTypes::Klarna => "klarna", PaymentLinkPaymentMethodTypes::Konbini => "konbini", PaymentLinkPaymentMethodTypes::Link => "link", + PaymentLinkPaymentMethodTypes::Mobilepay => "mobilepay", + PaymentLinkPaymentMethodTypes::Multibanco => "multibanco", PaymentLinkPaymentMethodTypes::Oxxo => "oxxo", PaymentLinkPaymentMethodTypes::P24 => "p24", PaymentLinkPaymentMethodTypes::Paynow => "paynow", @@ -3208,8 +3294,10 @@ impl PaymentLinkPaymentMethodTypes { PaymentLinkPaymentMethodTypes::SepaDebit => "sepa_debit", PaymentLinkPaymentMethodTypes::Sofort => "sofort", PaymentLinkPaymentMethodTypes::Swish => "swish", + PaymentLinkPaymentMethodTypes::Twint => "twint", PaymentLinkPaymentMethodTypes::UsBankAccount => "us_bank_account", PaymentLinkPaymentMethodTypes::WechatPay => "wechat_pay", + PaymentLinkPaymentMethodTypes::Zip => "zip", } } } @@ -4284,6 +4372,40 @@ impl std::default::Default for PaymentLinksResourceShippingAddressCollectionAllo } } +/// An enum representing the possible values of an `PaymentLinksResourceTaxIdCollection`'s `required` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentLinksResourceTaxIdCollectionRequired { + IfSupported, + Never, +} + +impl PaymentLinksResourceTaxIdCollectionRequired { + pub fn as_str(self) -> &'static str { + match self { + PaymentLinksResourceTaxIdCollectionRequired::IfSupported => "if_supported", + PaymentLinksResourceTaxIdCollectionRequired::Never => "never", + } + } +} + +impl AsRef for PaymentLinksResourceTaxIdCollectionRequired { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentLinksResourceTaxIdCollectionRequired { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentLinksResourceTaxIdCollectionRequired { + fn default() -> Self { + Self::IfSupported + } +} + /// 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")] @@ -4516,6 +4638,8 @@ pub enum UpdatePaymentLinkPaymentMethodTypes { Klarna, Konbini, Link, + Mobilepay, + Multibanco, Oxxo, P24, Paynow, @@ -4525,8 +4649,10 @@ pub enum UpdatePaymentLinkPaymentMethodTypes { SepaDebit, Sofort, Swish, + Twint, UsBankAccount, WechatPay, + Zip, } impl UpdatePaymentLinkPaymentMethodTypes { @@ -4550,6 +4676,8 @@ impl UpdatePaymentLinkPaymentMethodTypes { UpdatePaymentLinkPaymentMethodTypes::Klarna => "klarna", UpdatePaymentLinkPaymentMethodTypes::Konbini => "konbini", UpdatePaymentLinkPaymentMethodTypes::Link => "link", + UpdatePaymentLinkPaymentMethodTypes::Mobilepay => "mobilepay", + UpdatePaymentLinkPaymentMethodTypes::Multibanco => "multibanco", UpdatePaymentLinkPaymentMethodTypes::Oxxo => "oxxo", UpdatePaymentLinkPaymentMethodTypes::P24 => "p24", UpdatePaymentLinkPaymentMethodTypes::Paynow => "paynow", @@ -4559,8 +4687,10 @@ impl UpdatePaymentLinkPaymentMethodTypes { UpdatePaymentLinkPaymentMethodTypes::SepaDebit => "sepa_debit", UpdatePaymentLinkPaymentMethodTypes::Sofort => "sofort", UpdatePaymentLinkPaymentMethodTypes::Swish => "swish", + UpdatePaymentLinkPaymentMethodTypes::Twint => "twint", UpdatePaymentLinkPaymentMethodTypes::UsBankAccount => "us_bank_account", UpdatePaymentLinkPaymentMethodTypes::WechatPay => "wechat_pay", + UpdatePaymentLinkPaymentMethodTypes::Zip => "zip", } } } @@ -5397,3 +5527,37 @@ impl std::default::Default Self::Cancel } } + +/// An enum representing the possible values of an `UpdatePaymentLinkTaxIdCollection`'s `required` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentLinkTaxIdCollectionRequired { + IfSupported, + Never, +} + +impl UpdatePaymentLinkTaxIdCollectionRequired { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentLinkTaxIdCollectionRequired::IfSupported => "if_supported", + UpdatePaymentLinkTaxIdCollectionRequired::Never => "never", + } + } +} + +impl AsRef for UpdatePaymentLinkTaxIdCollectionRequired { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentLinkTaxIdCollectionRequired { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentLinkTaxIdCollectionRequired { + fn default() -> Self { + Self::IfSupported + } +} diff --git a/src/resources/generated/payment_method.rs b/src/resources/generated/payment_method.rs index 88e7c5060..71c8eeab2 100644 --- a/src/resources/generated/payment_method.rs +++ b/src/resources/generated/payment_method.rs @@ -8,8 +8,17 @@ 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, + BillingDetails, CardDetails, CardPresent, Customer, PaymentFlowsPrivatePaymentMethodsAlipay, + PaymentMethodAcssDebit, PaymentMethodAffirm, PaymentMethodAfterpayClearpay, + PaymentMethodAmazonPay, PaymentMethodAuBecsDebit, PaymentMethodBacsDebit, + PaymentMethodBancontact, PaymentMethodBlik, PaymentMethodBoleto, PaymentMethodCashapp, + PaymentMethodCustomerBalance, PaymentMethodEps, PaymentMethodFpx, PaymentMethodGiropay, + PaymentMethodGrabpay, PaymentMethodIdeal, PaymentMethodInteracPresent, PaymentMethodKlarna, + PaymentMethodKonbini, PaymentMethodLink, PaymentMethodMobilepay, PaymentMethodMultibanco, + PaymentMethodOxxo, PaymentMethodP24, PaymentMethodPaynow, PaymentMethodPaypal, + PaymentMethodPix, PaymentMethodPromptpay, PaymentMethodRevolutPay, PaymentMethodSepaDebit, + PaymentMethodSofort, PaymentMethodSwish, PaymentMethodTwint, PaymentMethodUsBankAccount, + PaymentMethodWechatPay, PaymentMethodZip, RadarRadarOptions, }; /// The resource representing a Stripe "PaymentMethod". @@ -32,6 +41,16 @@ pub struct PaymentMethod { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + /// This field indicates whether this payment method can be shown again to its customer in a checkout flow. + /// + /// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + /// The field defaults to “unspecified”. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redisplay: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub au_becs_debit: Option, @@ -106,6 +125,12 @@ pub struct PaymentMethod { /// 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 mobilepay: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub oxxo: Option, @@ -139,6 +164,9 @@ pub struct PaymentMethod { #[serde(skip_serializing_if = "Option::is_none")] pub swish: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: Option, + /// The type of the PaymentMethod. /// /// An additional hash is included on the PaymentMethod with a name matching this value. @@ -206,1681 +234,602 @@ impl Object for PaymentMethod { } } -#[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.). +/// 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 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, + pub acss_debit: 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.*. + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: String, + pub affirm: Option, - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, + pub afterpay_clearpay: Option, - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. #[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, + pub alipay: Option, - /// The preferred network for co-branded cards. + /// This field indicates whether this payment method can be shown again to its customer in a checkout flow. /// - /// 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, + /// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + /// The field defaults to `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redisplay: Option, - /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub cvc_check: Option, -} + /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: 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, + /// 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, - /// 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, + /// 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, - /// 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, + /// 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 high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). + /// 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 description: Option, + pub billing_details: Option, - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, + /// 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, - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, + /// 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, - /// Uniquely identifies this particular card number. + /// If this is a `card` PaymentMethod, this hash contains the user's card details. /// - /// 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, + /// 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, - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: 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, - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). + /// The `Customer` to whom the original PaymentMethod is attached. #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, + pub customer: Option, - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, + pub customer_balance: Option, - /// The last four digits of the card. - pub last4: 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, - /// Contains information about card networks that can be used to process the payment. - pub networks: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Expand::is_empty")] + pub expand: &'a [&'a str], - /// How card details were read in this transaction. - pub read_method: 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, -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletDetails { + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. #[serde(skip_serializing_if = "Option::is_none")] - pub amex_express_checkout: Option, + 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 apple_pay: Option, + pub grabpay: Option, - /// (For tokenized numbers only.) The last four digits of the device account number. - pub dynamic_last4: 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 google_pay: Option, + 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 link: Option, + 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 masterpass: Option, + 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 samsung_pay: Option, + pub link: Option, - /// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. /// - /// 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, - + /// This can be useful for storing additional information about the object in a structured 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 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 {} + pub metadata: Option, -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCardWalletLink {} + /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, -#[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
, + /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: 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, + /// 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, - /// 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, + /// 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, - /// 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
, -} + /// The PaymentMethod to share. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option, -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletSamsungPay {} + /// 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, -#[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
, + /// 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, - /// 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, + /// 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, - /// 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, + /// 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, - /// Owner's verified shipping address. + /// Options to configure Radar. /// - /// 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
, -} + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: 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, + /// 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 public identifier for buyers using Cash App. - pub cashtag: 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, -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCustomerBalance {} + /// 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, -#[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, -} + /// 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, -#[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, + /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: Option, - /// The customer's bank, if provided. + /// The type of the PaymentMethod. /// - /// 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 {} + /// 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, -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodGrabpay {} + /// 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, -#[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, + /// 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, - /// The Bank Identifier Code of the customer's bank, if the bank was provided. - pub bic: 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 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, +impl<'a> CreatePaymentMethod<'a> { + pub fn new() -> Self { + CreatePaymentMethod { + acss_debit: Default::default(), + affirm: Default::default(), + afterpay_clearpay: Default::default(), + alipay: Default::default(), + allow_redisplay: Default::default(), + amazon_pay: 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(), + mobilepay: Default::default(), + multibanco: 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(), + twint: Default::default(), + type_: Default::default(), + us_bank_account: Default::default(), + wechat_pay: Default::default(), + zip: Default::default(), + } + } +} - /// 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, +/// 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 high-level description of the type of cards issued in this range. + /// A cursor for use in pagination. /// - /// (For internal use only and not typically available in standard API requests.). + /// `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 description: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, + pub ending_before: Option, - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Expand::is_empty")] + pub expand: &'a [&'a str], - /// Uniquely identifies this particular card number. + /// A limit on the number of objects to be returned. /// - /// 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, + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, - /// Card funding type. + /// A cursor for use in pagination. /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, + /// `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, - /// Issuer identification number of the card. + /// An optional filter on the list, based on the object `type` field. /// - /// (For internal use only and not typically available in standard API requests.). + /// 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 iin: Option, + pub type_: Option, +} - /// The name of the card's issuing bank. +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> { + /// This field indicates whether this payment method can be shown again to its customer in a checkout flow. /// - /// (For internal use only and not typically available in standard API requests.). + /// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + /// The field defaults to `unspecified`. #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, + pub allow_redisplay: 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 `card` PaymentMethod, this hash contains the user's card details. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, - /// The last four digits of the card. - pub last4: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Expand::is_empty")] + pub expand: &'a [&'a str], - /// Contains information about card networks that can be used to process the payment. - pub networks: 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, - /// EMV tag 5F2D. + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. /// - /// Preferred languages specified by the integrated circuit chip. - pub preferred_locales: Option>, + /// This can be useful for storing additional information about the object in a structured 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, - /// How card details were read in this transaction. - pub read_method: 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, } -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodKlarna { - /// The customer's date of birth, if provided. - pub dob: Option, +impl<'a> UpdatePaymentMethod<'a> { + pub fn new() -> Self { + UpdatePaymentMethod { + allow_redisplay: Default::default(), + 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 PaymentFlowsPrivatePaymentMethodsKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: Option, +pub struct CreatePaymentMethodAcssDebit { + /// Customer's bank account number. + pub account_number: String, - /// The month of birth, between 1 and 12. - pub month: Option, + /// Institution number of the customer's bank. + pub institution_number: String, - /// The four-digit year of birth. - pub year: Option, + /// Transit number of the customer's bank. + pub transit_number: String, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodKonbini {} +pub struct CreatePaymentMethodAffirm {} #[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, -} +pub struct CreatePaymentMethodAfterpayClearpay {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOxxo {} +pub struct CreatePaymentMethodAlipay {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodP24 { - /// The customer's bank, if provided. - pub bank: Option, -} +pub struct CreatePaymentMethodAmazonPay {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodPaynow {} +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 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, +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, - /// PayPal account PayerID. + /// Sort code of the bank account. /// - /// This identifier uniquely identifies the PayPal customer. - pub payer_id: Option, + /// (e.g., `10-20-30`). + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodPix {} +pub struct CreatePaymentMethodBancontact {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodPromptpay {} +pub struct CreatePaymentMethodBlik {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodRevolutPay {} +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 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, +pub struct CreatePaymentMethodCashapp {} - /// Information about the object that generated this PaymentMethod. - pub generated_from: Option, +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodCustomerBalance {} - /// Last four characters of the IBAN. - pub last4: Option, +#[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 PaymentMethodSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: Option, +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 PaymentMethodSwish {} +pub struct CreatePaymentMethodGiropay {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodUsBankAccount { - /// Account holder type: individual or company. - pub account_holder_type: Option, +pub struct CreatePaymentMethodGrabpay {} - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - pub account_type: Option, +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} - /// The name of the bank. - pub bank_name: Option, +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodInteracPresent {} - /// The ID of the Financial Connections Account used to create the payment method. - pub financial_connections_account: Option, +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodKlarna { + /// Customer's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodKonbini {} - /// Last four digits of the bank account number. - pub last4: Option, +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodLink {} - /// Contains information about US bank account networks that can be used. - pub networks: Option, +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodMobilepay {} - /// Routing number of the bank account. - pub routing_number: Option, +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodMultibanco {} - /// Contains information about the future reusability of this PaymentMethod. - pub status_details: Option, -} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodOxxo {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodUsBankAccountStatusDetails { +pub struct CreatePaymentMethodP24 { + /// The customer's bank. #[serde(skip_serializing_if = "Option::is_none")] - pub blocked: Option, + pub bank: 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, -} +pub struct CreatePaymentMethodPaynow {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodWechatPay {} +pub struct CreatePaymentMethodPaypal {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodZip {} +pub struct CreatePaymentMethodPix {} #[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>, -} +pub struct CreatePaymentMethodPromptpay {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ThreeDSecureUsage { - /// Whether 3D Secure is supported on this card. - pub supported: bool, +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 UsBankAccountNetworks { - /// The preferred network. - pub preferred: Option, +pub struct CreatePaymentMethodRevolutPay {} - /// All supported networks. - pub supported: Vec, +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodSepaDebit { + /// IBAN of the bank account. + pub iban: String, } -/// 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, +#[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, +} - /// 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, +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodSwish {} - /// 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, +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodTwint {} - /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodUsBankAccount { + /// Account holder type: individual or company. #[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(), - } - } -} + pub account_holder_type: Option, -/// The parameters for `PaymentMethod::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPaymentMethods<'a> { - /// The ID of the customer whose PaymentMethods will be retrieved. + /// Account number of the bank account. #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, + pub account_number: Option, - /// A cursor for use in pagination. + /// Account type: checkings or savings. /// - /// `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. + /// Defaults to checking if omitted. #[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, + 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", - } - } -} + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option, -impl AsRef for CreatePaymentMethodUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option, } -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 - } -} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodWechatPay {} -/// 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, -} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodZip {} -impl CreatePaymentMethodUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodUsBankAccountAccountType::Checking => "checking", - CreatePaymentMethodUsBankAccountAccountType::Savings => "savings", - } - } -} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodLink {} -impl AsRef for CreatePaymentMethodUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} +#[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, -impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } + /// Bank account type. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, } -impl std::default::Default for CreatePaymentMethodUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } + +#[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 `PaymentMethodEps`'s `bank` field. +/// 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 PaymentMethodEpsBank { +pub enum CreatePaymentMethodEpsBank { ArzteUndApothekerBank, AustrianAnadiBankAg, BankAustria, @@ -1911,108 +860,108 @@ pub enum PaymentMethodEpsBank { VrBankBraunau, } -impl PaymentMethodEpsBank { +impl CreatePaymentMethodEpsBank { 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 => { + 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" } - 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 => { + 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" } - PaymentMethodEpsBank::HypoBankBurgenlandAktiengesellschaft => { + CreatePaymentMethodEpsBank::HypoBankBurgenlandAktiengesellschaft => { "hypo_bank_burgenland_aktiengesellschaft" } - PaymentMethodEpsBank::HypoNoeLbFurNiederosterreichUWien => { + CreatePaymentMethodEpsBank::HypoNoeLbFurNiederosterreichUWien => { "hypo_noe_lb_fur_niederosterreich_u_wien" } - PaymentMethodEpsBank::HypoOberosterreichSalzburgSteiermark => { + CreatePaymentMethodEpsBank::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 => { + 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" } - PaymentMethodEpsBank::SchoellerbankAg => "schoellerbank_ag", - PaymentMethodEpsBank::SpardaBankWien => "sparda_bank_wien", - PaymentMethodEpsBank::VolksbankGruppe => "volksbank_gruppe", - PaymentMethodEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - PaymentMethodEpsBank::VrBankBraunau => "vr_bank_braunau", + 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 PaymentMethodEpsBank { +impl AsRef for CreatePaymentMethodEpsBank { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for PaymentMethodEpsBank { +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 PaymentMethodEpsBank { +impl std::default::Default for CreatePaymentMethodEpsBank { fn default() -> Self { Self::ArzteUndApothekerBank } } -/// An enum representing the possible values of an `PaymentMethodFpx`'s `account_holder_type` field. +/// 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 PaymentMethodFpxAccountHolderType { +pub enum CreatePaymentMethodFpxAccountHolderType { Company, Individual, } -impl PaymentMethodFpxAccountHolderType { +impl CreatePaymentMethodFpxAccountHolderType { pub fn as_str(self) -> &'static str { match self { - PaymentMethodFpxAccountHolderType::Company => "company", - PaymentMethodFpxAccountHolderType::Individual => "individual", + CreatePaymentMethodFpxAccountHolderType::Company => "company", + CreatePaymentMethodFpxAccountHolderType::Individual => "individual", } } } -impl AsRef for PaymentMethodFpxAccountHolderType { +impl AsRef for CreatePaymentMethodFpxAccountHolderType { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for PaymentMethodFpxAccountHolderType { +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 PaymentMethodFpxAccountHolderType { +impl std::default::Default for CreatePaymentMethodFpxAccountHolderType { fn default() -> Self { Self::Company } } -/// An enum representing the possible values of an `PaymentMethodFpx`'s `bank` field. +/// 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 PaymentMethodFpxBank { +pub enum CreatePaymentMethodFpxBank { AffinBank, Agrobank, AllianceBank, @@ -2037,56 +986,56 @@ pub enum PaymentMethodFpxBank { Uob, } -impl PaymentMethodFpxBank { +impl CreatePaymentMethodFpxBank { 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", + 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 PaymentMethodFpxBank { +impl AsRef for CreatePaymentMethodFpxBank { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for PaymentMethodFpxBank { +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 PaymentMethodFpxBank { +impl std::default::Default for CreatePaymentMethodFpxBank { fn default() -> Self { Self::AffinBank } } -/// An enum representing the possible values of an `PaymentMethodIdeal`'s `bank` field. +/// 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 PaymentMethodIdealBank { +pub enum CreatePaymentMethodIdealBank { AbnAmro, AsnBank, Bunq, @@ -2105,250 +1054,277 @@ pub enum PaymentMethodIdealBank { Yoursafe, } -impl PaymentMethodIdealBank { +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 { - 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", + CreatePaymentMethodSofortCountry::At => "AT", + CreatePaymentMethodSofortCountry::Be => "BE", + CreatePaymentMethodSofortCountry::De => "DE", + CreatePaymentMethodSofortCountry::Es => "ES", + CreatePaymentMethodSofortCountry::It => "IT", + CreatePaymentMethodSofortCountry::Nl => "NL", } } } -impl AsRef for PaymentMethodIdealBank { +impl AsRef for CreatePaymentMethodSofortCountry { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for PaymentMethodIdealBank { +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 PaymentMethodIdealBank { +impl std::default::Default for CreatePaymentMethodSofortCountry { fn default() -> Self { - Self::AbnAmro + Self::At } } -/// An enum representing the possible values of an `PaymentMethodIdeal`'s `bic` field. +/// 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 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 enum CreatePaymentMethodUsBankAccountAccountHolderType { + Company, + Individual, +} + +impl CreatePaymentMethodUsBankAccountAccountHolderType { 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", + CreatePaymentMethodUsBankAccountAccountHolderType::Company => "company", + CreatePaymentMethodUsBankAccountAccountHolderType::Individual => "individual", } } } -impl AsRef for PaymentMethodIdealBic { +impl AsRef for CreatePaymentMethodUsBankAccountAccountHolderType { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for PaymentMethodIdealBic { +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 PaymentMethodIdealBic { +impl std::default::Default for CreatePaymentMethodUsBankAccountAccountHolderType { fn default() -> Self { - Self::Abnanl2a + Self::Company } } -/// An enum representing the possible values of an `PaymentMethodInteracPresent`'s `read_method` field. +/// 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 PaymentMethodInteracPresentReadMethod { - ContactEmv, - ContactlessEmv, - ContactlessMagstripeMode, - MagneticStripeFallback, - MagneticStripeTrack2, +pub enum CreatePaymentMethodUsBankAccountAccountType { + Checking, + Savings, } -impl PaymentMethodInteracPresentReadMethod { +impl CreatePaymentMethodUsBankAccountAccountType { 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", + CreatePaymentMethodUsBankAccountAccountType::Checking => "checking", + CreatePaymentMethodUsBankAccountAccountType::Savings => "savings", } } } -impl AsRef for PaymentMethodInteracPresentReadMethod { +impl AsRef for CreatePaymentMethodUsBankAccountAccountType { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for PaymentMethodInteracPresentReadMethod { +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 PaymentMethodInteracPresentReadMethod { +impl std::default::Default for CreatePaymentMethodUsBankAccountAccountType { fn default() -> Self { - Self::ContactEmv + Self::Checking } } -/// An enum representing the possible values of an `PaymentMethodP24`'s `bank` field. +/// An enum representing the possible values of an `PaymentMethod`'s `allow_redisplay` 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, +pub enum PaymentMethodAllowRedisplay { + Always, + Limited, + Unspecified, } -impl PaymentMethodP24Bank { +impl PaymentMethodAllowRedisplay { 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", + PaymentMethodAllowRedisplay::Always => "always", + PaymentMethodAllowRedisplay::Limited => "limited", + PaymentMethodAllowRedisplay::Unspecified => "unspecified", } } } -impl AsRef for PaymentMethodP24Bank { +impl AsRef for PaymentMethodAllowRedisplay { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for PaymentMethodP24Bank { +impl std::fmt::Display for PaymentMethodAllowRedisplay { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { self.as_str().fmt(f) } } -impl std::default::Default for PaymentMethodP24Bank { +impl std::default::Default for PaymentMethodAllowRedisplay { fn default() -> Self { - Self::AliorBank + Self::Always } } @@ -2360,6 +1336,7 @@ pub enum PaymentMethodType { Affirm, AfterpayClearpay, Alipay, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -2378,6 +1355,8 @@ pub enum PaymentMethodType { Klarna, Konbini, Link, + Mobilepay, + Multibanco, Oxxo, P24, Paynow, @@ -2388,6 +1367,7 @@ pub enum PaymentMethodType { SepaDebit, Sofort, Swish, + Twint, UsBankAccount, WechatPay, Zip, @@ -2400,6 +1380,7 @@ impl PaymentMethodType { PaymentMethodType::Affirm => "affirm", PaymentMethodType::AfterpayClearpay => "afterpay_clearpay", PaymentMethodType::Alipay => "alipay", + PaymentMethodType::AmazonPay => "amazon_pay", PaymentMethodType::AuBecsDebit => "au_becs_debit", PaymentMethodType::BacsDebit => "bacs_debit", PaymentMethodType::Bancontact => "bancontact", @@ -2418,6 +1399,8 @@ impl PaymentMethodType { PaymentMethodType::Klarna => "klarna", PaymentMethodType::Konbini => "konbini", PaymentMethodType::Link => "link", + PaymentMethodType::Mobilepay => "mobilepay", + PaymentMethodType::Multibanco => "multibanco", PaymentMethodType::Oxxo => "oxxo", PaymentMethodType::P24 => "p24", PaymentMethodType::Paynow => "paynow", @@ -2428,6 +1411,7 @@ impl PaymentMethodType { PaymentMethodType::SepaDebit => "sepa_debit", PaymentMethodType::Sofort => "sofort", PaymentMethodType::Swish => "swish", + PaymentMethodType::Twint => "twint", PaymentMethodType::UsBankAccount => "us_bank_account", PaymentMethodType::WechatPay => "wechat_pay", PaymentMethodType::Zip => "zip", @@ -2460,6 +1444,7 @@ pub enum PaymentMethodTypeFilter { Affirm, AfterpayClearpay, Alipay, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -2476,6 +1461,8 @@ pub enum PaymentMethodTypeFilter { Klarna, Konbini, Link, + Mobilepay, + Multibanco, Oxxo, P24, Paynow, @@ -2486,6 +1473,7 @@ pub enum PaymentMethodTypeFilter { SepaDebit, Sofort, Swish, + Twint, UsBankAccount, WechatPay, Zip, @@ -2498,6 +1486,7 @@ impl PaymentMethodTypeFilter { PaymentMethodTypeFilter::Affirm => "affirm", PaymentMethodTypeFilter::AfterpayClearpay => "afterpay_clearpay", PaymentMethodTypeFilter::Alipay => "alipay", + PaymentMethodTypeFilter::AmazonPay => "amazon_pay", PaymentMethodTypeFilter::AuBecsDebit => "au_becs_debit", PaymentMethodTypeFilter::BacsDebit => "bacs_debit", PaymentMethodTypeFilter::Bancontact => "bancontact", @@ -2514,6 +1503,8 @@ impl PaymentMethodTypeFilter { PaymentMethodTypeFilter::Klarna => "klarna", PaymentMethodTypeFilter::Konbini => "konbini", PaymentMethodTypeFilter::Link => "link", + PaymentMethodTypeFilter::Mobilepay => "mobilepay", + PaymentMethodTypeFilter::Multibanco => "multibanco", PaymentMethodTypeFilter::Oxxo => "oxxo", PaymentMethodTypeFilter::P24 => "p24", PaymentMethodTypeFilter::Paynow => "paynow", @@ -2524,6 +1515,7 @@ impl PaymentMethodTypeFilter { PaymentMethodTypeFilter::SepaDebit => "sepa_debit", PaymentMethodTypeFilter::Sofort => "sofort", PaymentMethodTypeFilter::Swish => "swish", + PaymentMethodTypeFilter::Twint => "twint", PaymentMethodTypeFilter::UsBankAccount => "us_bank_account", PaymentMethodTypeFilter::WechatPay => "wechat_pay", PaymentMethodTypeFilter::Zip => "zip", @@ -2548,186 +1540,6 @@ impl std::default::Default for PaymentMethodTypeFilter { } } -/// 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")] @@ -2796,84 +1608,6 @@ impl std::default::Default for UpdatePaymentMethodUsBankAccountAccountType { } } -/// 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"}`. @@ -2897,10 +1631,24 @@ pub struct CardDetailsParams { pub exp_month: i32, /// Four-digit number representing the card's expiration year. pub exp_year: i32, + /// Contains information about card networks used to process the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option, /// The card number, as a string without any separators. pub number: String, } +/// Contains information about card networks used to process the payment. +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct Networks { + /// The customer's preferred card network for co-branded cards. + /// + /// Supports `cartes_bancaires`, `mastercard`, or `visa`. + /// Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred: Option, +} + #[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"}. @@ -2916,4 +1664,18 @@ pub struct UpdateApiParam { /// Four-digit number representing the card's expiration year. #[serde(skip_serializing_if = "Option::is_none")] pub exp_year: Option, + /// Contains information about card networks used to process the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option, +} + +/// Contains information about card networks used to process the payment. +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct Networks { + /// The customer's preferred card network for co-branded cards. + /// + /// Supports `cartes_bancaires`, `mastercard`, or `visa`. + /// Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred: Option, } diff --git a/src/resources/generated/payment_method_acss_debit.rs b/src/resources/generated/payment_method_acss_debit.rs new file mode 100644 index 000000000..5a2078b00 --- /dev/null +++ b/src/resources/generated/payment_method_acss_debit.rs @@ -0,0 +1,27 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_acss_debit". +#[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, +} diff --git a/src/resources/generated/payment_method_affirm.rs b/src/resources/generated/payment_method_affirm.rs new file mode 100644 index 000000000..fae00953d --- /dev/null +++ b/src/resources/generated/payment_method_affirm.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_affirm". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodAffirm { +} diff --git a/src/resources/generated/payment_method_afterpay_clearpay.rs b/src/resources/generated/payment_method_afterpay_clearpay.rs new file mode 100644 index 000000000..57d63c2a9 --- /dev/null +++ b/src/resources/generated/payment_method_afterpay_clearpay.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_afterpay_clearpay". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodAfterpayClearpay { +} diff --git a/src/resources/generated/payment_method_amazon_pay.rs b/src/resources/generated/payment_method_amazon_pay.rs new file mode 100644 index 000000000..dde030680 --- /dev/null +++ b/src/resources/generated/payment_method_amazon_pay.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_amazon_pay". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodAmazonPay { +} diff --git a/src/resources/generated/payment_method_au_becs_debit.rs b/src/resources/generated/payment_method_au_becs_debit.rs new file mode 100644 index 000000000..02634dc36 --- /dev/null +++ b/src/resources/generated/payment_method_au_becs_debit.rs @@ -0,0 +1,21 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_au_becs_debit". +#[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, +} diff --git a/src/resources/generated/payment_method_bacs_debit.rs b/src/resources/generated/payment_method_bacs_debit.rs new file mode 100644 index 000000000..ad95a73b5 --- /dev/null +++ b/src/resources/generated/payment_method_bacs_debit.rs @@ -0,0 +1,23 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_bacs_debit". +#[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, +} diff --git a/src/resources/generated/payment_method_bancontact.rs b/src/resources/generated/payment_method_bancontact.rs new file mode 100644 index 000000000..dfb2b31b2 --- /dev/null +++ b/src/resources/generated/payment_method_bancontact.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_bancontact". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodBancontact { +} diff --git a/src/resources/generated/payment_method_blik.rs b/src/resources/generated/payment_method_blik.rs new file mode 100644 index 000000000..9b9486a3e --- /dev/null +++ b/src/resources/generated/payment_method_blik.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_blik". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodBlik { +} diff --git a/src/resources/generated/payment_method_boleto.rs b/src/resources/generated/payment_method_boleto.rs new file mode 100644 index 000000000..1db6d9e2b --- /dev/null +++ b/src/resources/generated/payment_method_boleto.rs @@ -0,0 +1,13 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_boleto". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodBoleto { + + /// Uniquely identifies the customer tax id (CNPJ or CPF). + pub tax_id: String, +} diff --git a/src/resources/generated/payment_method_card.rs b/src/resources/generated/payment_method_card.rs new file mode 100644 index 000000000..489f7a157 --- /dev/null +++ b/src/resources/generated/payment_method_card.rs @@ -0,0 +1,294 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::params::{Expandable}; +use crate::resources::{Address, PaymentMethodDetailsCardPresent, SetupAttempt}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_card". +#[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, + + /// The brand to use when displaying the card, this accounts for customer's brand choice on dual-branded cards. + /// + /// Can be `american_express`, `cartes_bancaires`, `diners_club`, `discover`, `eftpos_australia`, `interac`, `jcb`, `mastercard`, `union_pay`, `visa`, or `other` and may contain more values in the future. + pub display_brand: 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, + + /// Details of the original PaymentMethod that created this object. + pub generated_from: 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: 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 PaymentMethodCardGeneratedCard { + + /// The charge that created this object. + pub charge: Option, + + /// Transaction-specific details of the payment method used in the payment. + pub payment_method_details: Option, + + /// The ID of the SetupAttempt that generated this PaymentMethod, if any. + pub setup_attempt: Option>, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CardGeneratedFromPaymentMethodDetails { + + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + + /// The type of payment method transaction-specific details from the transaction that generated this `card` payment method. + /// + /// Always `card_present`. + #[serde(rename = "type")] + pub type_: String, +} + +#[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 ThreeDSecureUsage { + + /// Whether 3D Secure is supported on this card. + pub supported: bool, +} + +/// 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 + } +} diff --git a/src/resources/generated/payment_method_card_present.rs b/src/resources/generated/payment_method_card_present.rs new file mode 100644 index 000000000..48b1fc331 --- /dev/null +++ b/src/resources/generated/payment_method_card_present.rs @@ -0,0 +1,126 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::resources::{PaymentFlowsPrivatePaymentMethodsCardPresentCommonWallet, PaymentMethodCardPresentNetworks, PaymentMethodDetailsCardPresentOffline}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_card_present". +#[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 [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + pub brand_product: 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, + + /// Details about payment methods collected offline. + pub offline: 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, + + #[serde(skip_serializing_if = "Option::is_none")] + pub wallet: Option, +} + +/// 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 + } +} 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_cashapp.rs b/src/resources/generated/payment_method_cashapp.rs new file mode 100644 index 000000000..9d45d2d1c --- /dev/null +++ b/src/resources/generated/payment_method_cashapp.rs @@ -0,0 +1,16 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_cashapp". +#[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, +} diff --git a/src/resources/generated/payment_method_configuration.rs b/src/resources/generated/payment_method_configuration.rs index edf42eed0..8150dd775 100644 --- a/src/resources/generated/payment_method_configuration.rs +++ b/src/resources/generated/payment_method_configuration.rs @@ -30,6 +30,9 @@ pub struct PaymentMethodConfiguration { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub apple_pay: Option, @@ -99,6 +102,12 @@ pub struct PaymentMethodConfiguration { /// 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 mobilepay: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + /// The configuration's name. pub name: String, @@ -129,11 +138,20 @@ pub struct PaymentMethodConfiguration { #[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 twint: 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, } impl PaymentMethodConfiguration { @@ -227,6 +245,10 @@ pub struct CreatePaymentMethodConfiguration<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + /// Amazon Pay is a wallet payment method that lets your customers check out the same way as on Amazon. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: 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. @@ -370,6 +392,17 @@ pub struct CreatePaymentMethodConfiguration<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, + /// MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. + /// + /// It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. + /// Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + + /// Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + /// Configuration name. #[serde(skip_serializing_if = "Option::is_none")] pub name: Option<&'a str>, @@ -430,6 +463,20 @@ pub struct CreatePaymentMethodConfiguration<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub sofort: Option, + /// Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. + /// + /// It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. + /// Check this [page](https://stripe.com/docs/payments/swish) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option, + + /// Twint is a payment method popular in Switzerland. + /// + /// It allows customers to pay using their mobile phone. + /// Check this [page](https://docs.stripe.com/payments/twint) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: 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. @@ -443,6 +490,12 @@ pub struct CreatePaymentMethodConfiguration<'a> { /// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. #[serde(skip_serializing_if = "Option::is_none")] pub wechat_pay: Option, + + /// Zip gives your customers a way to split purchases over a series of payments. + /// + /// Check this [page](https://stripe.com/docs/payments/zip) for more details like country availability. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, } impl<'a> CreatePaymentMethodConfiguration<'a> { @@ -452,6 +505,7 @@ impl<'a> CreatePaymentMethodConfiguration<'a> { affirm: Default::default(), afterpay_clearpay: Default::default(), alipay: Default::default(), + amazon_pay: Default::default(), apple_pay: Default::default(), apple_pay_later: Default::default(), au_becs_debit: Default::default(), @@ -474,6 +528,8 @@ impl<'a> CreatePaymentMethodConfiguration<'a> { klarna: Default::default(), konbini: Default::default(), link: Default::default(), + mobilepay: Default::default(), + multibanco: Default::default(), name: Default::default(), oxxo: Default::default(), p24: Default::default(), @@ -484,8 +540,11 @@ impl<'a> CreatePaymentMethodConfiguration<'a> { revolut_pay: Default::default(), sepa_debit: Default::default(), sofort: Default::default(), + swish: Default::default(), + twint: Default::default(), us_bank_account: Default::default(), wechat_pay: Default::default(), + zip: Default::default(), } } } @@ -498,16 +557,39 @@ pub struct ListPaymentMethodConfigurations<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub application: 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> ListPaymentMethodConfigurations<'a> { pub fn new() -> Self { ListPaymentMethodConfigurations { application: Default::default(), + ending_before: Default::default(), expand: Default::default(), + limit: Default::default(), + starting_after: Default::default(), } } } @@ -549,6 +631,10 @@ pub struct UpdatePaymentMethodConfiguration<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + /// Amazon Pay is a wallet payment method that lets your customers check out the same way as on Amazon. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: 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. @@ -692,6 +778,17 @@ pub struct UpdatePaymentMethodConfiguration<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, + /// MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. + /// + /// It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. + /// Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + + /// Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + /// Configuration name. #[serde(skip_serializing_if = "Option::is_none")] pub name: Option<&'a str>, @@ -746,6 +843,20 @@ pub struct UpdatePaymentMethodConfiguration<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub sofort: Option, + /// Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. + /// + /// It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. + /// Check this [page](https://stripe.com/docs/payments/swish) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option, + + /// Twint is a payment method popular in Switzerland. + /// + /// It allows customers to pay using their mobile phone. + /// Check this [page](https://docs.stripe.com/payments/twint) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: 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. @@ -759,6 +870,12 @@ pub struct UpdatePaymentMethodConfiguration<'a> { /// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. #[serde(skip_serializing_if = "Option::is_none")] pub wechat_pay: Option, + + /// Zip gives your customers a way to split purchases over a series of payments. + /// + /// Check this [page](https://stripe.com/docs/payments/zip) for more details like country availability. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, } impl<'a> UpdatePaymentMethodConfiguration<'a> { @@ -769,6 +886,7 @@ impl<'a> UpdatePaymentMethodConfiguration<'a> { affirm: Default::default(), afterpay_clearpay: Default::default(), alipay: Default::default(), + amazon_pay: Default::default(), apple_pay: Default::default(), apple_pay_later: Default::default(), au_becs_debit: Default::default(), @@ -791,6 +909,8 @@ impl<'a> UpdatePaymentMethodConfiguration<'a> { klarna: Default::default(), konbini: Default::default(), link: Default::default(), + mobilepay: Default::default(), + multibanco: Default::default(), name: Default::default(), oxxo: Default::default(), p24: Default::default(), @@ -800,8 +920,11 @@ impl<'a> UpdatePaymentMethodConfiguration<'a> { revolut_pay: Default::default(), sepa_debit: Default::default(), sofort: Default::default(), + swish: Default::default(), + twint: Default::default(), us_bank_account: Default::default(), wechat_pay: Default::default(), + zip: Default::default(), } } } @@ -838,6 +961,14 @@ pub struct CreatePaymentMethodConfigurationAlipay { pub display_preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodConfigurationAmazonPay { + + /// 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 { @@ -998,6 +1129,22 @@ pub struct CreatePaymentMethodConfigurationLink { pub display_preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodConfigurationMobilepay { + + /// 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 CreatePaymentMethodConfigurationMultibanco { + + /// 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 { @@ -1062,6 +1209,22 @@ pub struct CreatePaymentMethodConfigurationSofort { pub display_preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodConfigurationSwish { + + /// 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 CreatePaymentMethodConfigurationTwint { + + /// 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 { @@ -1078,6 +1241,14 @@ pub struct CreatePaymentMethodConfigurationWechatPay { pub display_preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodConfigurationZip { + + /// 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 { @@ -1110,6 +1281,14 @@ pub struct UpdatePaymentMethodConfigurationAlipay { pub display_preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodConfigurationAmazonPay { + + /// 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 { @@ -1270,6 +1449,22 @@ pub struct UpdatePaymentMethodConfigurationLink { pub display_preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodConfigurationMobilepay { + + /// 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 UpdatePaymentMethodConfigurationMultibanco { + + /// 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 { @@ -1334,6 +1529,22 @@ pub struct UpdatePaymentMethodConfigurationSofort { pub display_preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodConfigurationSwish { + + /// 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 UpdatePaymentMethodConfigurationTwint { + + /// 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 { @@ -1350,6 +1561,14 @@ pub struct UpdatePaymentMethodConfigurationWechatPay { pub display_preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodConfigurationZip { + + /// 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 { @@ -1382,6 +1601,14 @@ pub struct CreatePaymentMethodConfigurationAlipayDisplayPreference { pub preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodConfigurationAmazonPayDisplayPreference { + + /// 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 { @@ -1542,6 +1769,22 @@ pub struct CreatePaymentMethodConfigurationLinkDisplayPreference { pub preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodConfigurationMobilepayDisplayPreference { + + /// 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 CreatePaymentMethodConfigurationMultibancoDisplayPreference { + + /// 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 { @@ -1606,6 +1849,22 @@ pub struct CreatePaymentMethodConfigurationSofortDisplayPreference { pub preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodConfigurationSwishDisplayPreference { + + /// 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 CreatePaymentMethodConfigurationTwintDisplayPreference { + + /// 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 { @@ -1622,6 +1881,14 @@ pub struct CreatePaymentMethodConfigurationWechatPayDisplayPreference { pub preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodConfigurationZipDisplayPreference { + + /// 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 { @@ -1654,6 +1921,14 @@ pub struct UpdatePaymentMethodConfigurationAlipayDisplayPreference { pub preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodConfigurationAmazonPayDisplayPreference { + + /// 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 { @@ -1814,6 +2089,22 @@ pub struct UpdatePaymentMethodConfigurationLinkDisplayPreference { pub preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodConfigurationMobilepayDisplayPreference { + + /// 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 UpdatePaymentMethodConfigurationMultibancoDisplayPreference { + + /// 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 { @@ -1878,6 +2169,22 @@ pub struct UpdatePaymentMethodConfigurationSofortDisplayPreference { pub preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodConfigurationSwishDisplayPreference { + + /// 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 UpdatePaymentMethodConfigurationTwintDisplayPreference { + + /// 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 { @@ -1894,6 +2201,14 @@ pub struct UpdatePaymentMethodConfigurationWechatPayDisplayPreference { pub preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodConfigurationZipDisplayPreference { + + /// 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")] @@ -2038,6 +2353,42 @@ impl std::default::Default for CreatePaymentMethodConfigurationAlipayDisplayPref } } +/// An enum representing the possible values of an `CreatePaymentMethodConfigurationAmazonPayDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference { + None, + Off, + On, +} + +impl CreatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference::None => "none", + CreatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference::Off => "off", + CreatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for CreatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference { + 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")] @@ -2758,98 +3109,170 @@ impl std::default::Default for CreatePaymentMethodConfigurationLinkDisplayPrefer } } -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationOxxoDisplayPreference`'s `preference` field. +/// An enum representing the possible values of an `CreatePaymentMethodConfigurationMobilepayDisplayPreference`'s `preference` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { +pub enum CreatePaymentMethodConfigurationMobilepayDisplayPreferencePreference { None, Off, On, } -impl CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { +impl CreatePaymentMethodConfigurationMobilepayDisplayPreferencePreference { pub fn as_str(self) -> &'static str { match self { - CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::On => "on", + CreatePaymentMethodConfigurationMobilepayDisplayPreferencePreference::None => "none", + CreatePaymentMethodConfigurationMobilepayDisplayPreferencePreference::Off => "off", + CreatePaymentMethodConfigurationMobilepayDisplayPreferencePreference::On => "on", } } } -impl AsRef for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { +impl AsRef for CreatePaymentMethodConfigurationMobilepayDisplayPreferencePreference { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { +impl std::fmt::Display for CreatePaymentMethodConfigurationMobilepayDisplayPreferencePreference { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { self.as_str().fmt(f) } } -impl std::default::Default for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { +impl std::default::Default for CreatePaymentMethodConfigurationMobilepayDisplayPreferencePreference { fn default() -> Self { Self::None } } -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationP24DisplayPreference`'s `preference` field. +/// An enum representing the possible values of an `CreatePaymentMethodConfigurationMultibancoDisplayPreference`'s `preference` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationP24DisplayPreferencePreference { +pub enum CreatePaymentMethodConfigurationMultibancoDisplayPreferencePreference { None, Off, On, } -impl CreatePaymentMethodConfigurationP24DisplayPreferencePreference { +impl CreatePaymentMethodConfigurationMultibancoDisplayPreferencePreference { pub fn as_str(self) -> &'static str { match self { - CreatePaymentMethodConfigurationP24DisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationP24DisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationP24DisplayPreferencePreference::On => "on", + CreatePaymentMethodConfigurationMultibancoDisplayPreferencePreference::None => "none", + CreatePaymentMethodConfigurationMultibancoDisplayPreferencePreference::Off => "off", + CreatePaymentMethodConfigurationMultibancoDisplayPreferencePreference::On => "on", } } } -impl AsRef for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { +impl AsRef for CreatePaymentMethodConfigurationMultibancoDisplayPreferencePreference { fn as_ref(&self) -> &str { self.as_str() } } -impl std::fmt::Display for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { +impl std::fmt::Display for CreatePaymentMethodConfigurationMultibancoDisplayPreferencePreference { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { self.as_str().fmt(f) } } -impl std::default::Default for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { +impl std::default::Default for CreatePaymentMethodConfigurationMultibancoDisplayPreferencePreference { fn default() -> Self { Self::None } } -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationPaynowDisplayPreference`'s `preference` field. +/// 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 CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { +pub enum CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { None, Off, On, } -impl CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { +impl CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { pub fn as_str(self) -> &'static str { match self { - CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference::On => "on", + CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::None => "none", + CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::Off => "off", + CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::On => "on", } } } -impl AsRef for CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { +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() } @@ -3046,6 +3469,78 @@ impl std::default::Default for CreatePaymentMethodConfigurationSofortDisplayPref } } +/// An enum representing the possible values of an `CreatePaymentMethodConfigurationSwishDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentMethodConfigurationSwishDisplayPreferencePreference { + None, + Off, + On, +} + +impl CreatePaymentMethodConfigurationSwishDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentMethodConfigurationSwishDisplayPreferencePreference::None => "none", + CreatePaymentMethodConfigurationSwishDisplayPreferencePreference::Off => "off", + CreatePaymentMethodConfigurationSwishDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for CreatePaymentMethodConfigurationSwishDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentMethodConfigurationSwishDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentMethodConfigurationSwishDisplayPreferencePreference { + fn default() -> Self { + Self::None + } +} + +/// An enum representing the possible values of an `CreatePaymentMethodConfigurationTwintDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentMethodConfigurationTwintDisplayPreferencePreference { + None, + Off, + On, +} + +impl CreatePaymentMethodConfigurationTwintDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentMethodConfigurationTwintDisplayPreferencePreference::None => "none", + CreatePaymentMethodConfigurationTwintDisplayPreferencePreference::Off => "off", + CreatePaymentMethodConfigurationTwintDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for CreatePaymentMethodConfigurationTwintDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentMethodConfigurationTwintDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentMethodConfigurationTwintDisplayPreferencePreference { + 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")] @@ -3118,6 +3613,42 @@ impl std::default::Default for CreatePaymentMethodConfigurationWechatPayDisplayP } } +/// An enum representing the possible values of an `CreatePaymentMethodConfigurationZipDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentMethodConfigurationZipDisplayPreferencePreference { + None, + Off, + On, +} + +impl CreatePaymentMethodConfigurationZipDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentMethodConfigurationZipDisplayPreferencePreference::None => "none", + CreatePaymentMethodConfigurationZipDisplayPreferencePreference::Off => "off", + CreatePaymentMethodConfigurationZipDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for CreatePaymentMethodConfigurationZipDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentMethodConfigurationZipDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentMethodConfigurationZipDisplayPreferencePreference { + 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")] @@ -3332,6 +3863,42 @@ impl std::default::Default for UpdatePaymentMethodConfigurationAlipayDisplayPref } } +/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationAmazonPayDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference { + None, + Off, + On, +} + +impl UpdatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference::None => "none", + UpdatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference::Off => "off", + UpdatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for UpdatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentMethodConfigurationAmazonPayDisplayPreferencePreference { + 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")] @@ -4052,6 +4619,78 @@ impl std::default::Default for UpdatePaymentMethodConfigurationLinkDisplayPrefer } } +/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationMobilepayDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentMethodConfigurationMobilepayDisplayPreferencePreference { + None, + Off, + On, +} + +impl UpdatePaymentMethodConfigurationMobilepayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentMethodConfigurationMobilepayDisplayPreferencePreference::None => "none", + UpdatePaymentMethodConfigurationMobilepayDisplayPreferencePreference::Off => "off", + UpdatePaymentMethodConfigurationMobilepayDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for UpdatePaymentMethodConfigurationMobilepayDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentMethodConfigurationMobilepayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentMethodConfigurationMobilepayDisplayPreferencePreference { + fn default() -> Self { + Self::None + } +} + +/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationMultibancoDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentMethodConfigurationMultibancoDisplayPreferencePreference { + None, + Off, + On, +} + +impl UpdatePaymentMethodConfigurationMultibancoDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentMethodConfigurationMultibancoDisplayPreferencePreference::None => "none", + UpdatePaymentMethodConfigurationMultibancoDisplayPreferencePreference::Off => "off", + UpdatePaymentMethodConfigurationMultibancoDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for UpdatePaymentMethodConfigurationMultibancoDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentMethodConfigurationMultibancoDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentMethodConfigurationMultibancoDisplayPreferencePreference { + 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")] @@ -4340,6 +4979,78 @@ impl std::default::Default for UpdatePaymentMethodConfigurationSofortDisplayPref } } +/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationSwishDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentMethodConfigurationSwishDisplayPreferencePreference { + None, + Off, + On, +} + +impl UpdatePaymentMethodConfigurationSwishDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentMethodConfigurationSwishDisplayPreferencePreference::None => "none", + UpdatePaymentMethodConfigurationSwishDisplayPreferencePreference::Off => "off", + UpdatePaymentMethodConfigurationSwishDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for UpdatePaymentMethodConfigurationSwishDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentMethodConfigurationSwishDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentMethodConfigurationSwishDisplayPreferencePreference { + fn default() -> Self { + Self::None + } +} + +/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationTwintDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentMethodConfigurationTwintDisplayPreferencePreference { + None, + Off, + On, +} + +impl UpdatePaymentMethodConfigurationTwintDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentMethodConfigurationTwintDisplayPreferencePreference::None => "none", + UpdatePaymentMethodConfigurationTwintDisplayPreferencePreference::Off => "off", + UpdatePaymentMethodConfigurationTwintDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for UpdatePaymentMethodConfigurationTwintDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentMethodConfigurationTwintDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentMethodConfigurationTwintDisplayPreferencePreference { + 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")] @@ -4412,6 +5123,42 @@ impl std::default::Default for UpdatePaymentMethodConfigurationWechatPayDisplayP } } +/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationZipDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentMethodConfigurationZipDisplayPreferencePreference { + None, + Off, + On, +} + +impl UpdatePaymentMethodConfigurationZipDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentMethodConfigurationZipDisplayPreferencePreference::None => "none", + UpdatePaymentMethodConfigurationZipDisplayPreferencePreference::Off => "off", + UpdatePaymentMethodConfigurationZipDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for UpdatePaymentMethodConfigurationZipDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentMethodConfigurationZipDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentMethodConfigurationZipDisplayPreferencePreference { + 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. diff --git a/src/resources/generated/payment_method_customer_balance.rs b/src/resources/generated/payment_method_customer_balance.rs new file mode 100644 index 000000000..66f744e3a --- /dev/null +++ b/src/resources/generated/payment_method_customer_balance.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_customer_balance". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodCustomerBalance { +} diff --git a/src/resources/generated/payment_method_details_card_present.rs b/src/resources/generated/payment_method_details_card_present.rs new file mode 100644 index 000000000..f6c76f473 --- /dev/null +++ b/src/resources/generated/payment_method_details_card_present.rs @@ -0,0 +1,240 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::params::{Timestamp}; +use crate::resources::{PaymentFlowsPrivatePaymentMethodsCardPresentCommonWallet, PaymentMethodDetailsCardPresentOffline}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_details_card_present". +#[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, + + /// The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + pub brand_product: 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, + + /// This is used by the financial networks to identify a transaction. + /// + /// Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. + /// The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). + /// This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + pub network_transaction_id: Option, + + /// Details about payments collected offline. + pub offline: Option, + + /// Defines whether the authorized amount can be over-captured or not. + pub overcapture_supported: bool, + + /// 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, + + #[serde(skip_serializing_if = "Option::is_none")] + pub wallet: 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, + + /// Describes the method used by the cardholder to verify ownership of the card. + /// + /// One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + 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, +} + +/// 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 + } +} diff --git a/src/resources/generated/payment_method_details_card_present_offline.rs b/src/resources/generated/payment_method_details_card_present_offline.rs new file mode 100644 index 000000000..32e2cde6d --- /dev/null +++ b/src/resources/generated/payment_method_details_card_present_offline.rs @@ -0,0 +1,52 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::params::{Timestamp}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_details_card_present_offline". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodDetailsCardPresentOffline { + + /// Time at which the payment was collected while offline. + pub stored_at: Option, + + /// The method used to process this payment method offline. + /// + /// Only deferred is allowed. + #[serde(rename = "type")] + pub type_: Option, +} + +/// An enum representing the possible values of an `PaymentMethodDetailsCardPresentOffline`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentMethodDetailsCardPresentOfflineType { + Deferred, +} + +impl PaymentMethodDetailsCardPresentOfflineType { + pub fn as_str(self) -> &'static str { + match self { + PaymentMethodDetailsCardPresentOfflineType::Deferred => "deferred", + } + } +} + +impl AsRef for PaymentMethodDetailsCardPresentOfflineType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentMethodDetailsCardPresentOfflineType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentMethodDetailsCardPresentOfflineType { + fn default() -> Self { + Self::Deferred + } +} diff --git a/src/resources/generated/payment_method_eps.rs b/src/resources/generated/payment_method_eps.rs new file mode 100644 index 000000000..ee27f6074 --- /dev/null +++ b/src/resources/generated/payment_method_eps.rs @@ -0,0 +1,101 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_eps". +#[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, +} + +/// 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 + } +} diff --git a/src/resources/generated/payment_method_fpx.rs b/src/resources/generated/payment_method_fpx.rs new file mode 100644 index 000000000..e668a97d1 --- /dev/null +++ b/src/resources/generated/payment_method_fpx.rs @@ -0,0 +1,128 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_fpx". +#[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, +} + +/// 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 + } +} diff --git a/src/resources/generated/payment_method_giropay.rs b/src/resources/generated/payment_method_giropay.rs new file mode 100644 index 000000000..0eb04b6b2 --- /dev/null +++ b/src/resources/generated/payment_method_giropay.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_giropay". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodGiropay { +} diff --git a/src/resources/generated/payment_method_grabpay.rs b/src/resources/generated/payment_method_grabpay.rs new file mode 100644 index 000000000..4bbe1dde3 --- /dev/null +++ b/src/resources/generated/payment_method_grabpay.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_grabpay". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodGrabpay { +} diff --git a/src/resources/generated/payment_method_ideal.rs b/src/resources/generated/payment_method_ideal.rs new file mode 100644 index 000000000..fb4d0b2fe --- /dev/null +++ b/src/resources/generated/payment_method_ideal.rs @@ -0,0 +1,161 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_ideal". +#[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, +} + +/// 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 + } +} diff --git a/src/resources/generated/payment_method_interac_present.rs b/src/resources/generated/payment_method_interac_present.rs new file mode 100644 index 000000000..848b47cc5 --- /dev/null +++ b/src/resources/generated/payment_method_interac_present.rs @@ -0,0 +1,117 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::resources::{PaymentMethodCardPresentNetworks}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_interac_present". +#[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, +} + +/// 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 + } +} diff --git a/src/resources/generated/payment_method_klarna.rs b/src/resources/generated/payment_method_klarna.rs new file mode 100644 index 000000000..3936504a5 --- /dev/null +++ b/src/resources/generated/payment_method_klarna.rs @@ -0,0 +1,27 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_klarna". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodKlarna { + + /// The customer's date of birth, if provided. + #[serde(skip_serializing_if = "Option::is_none")] + 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, +} diff --git a/src/resources/generated/payment_method_konbini.rs b/src/resources/generated/payment_method_konbini.rs new file mode 100644 index 000000000..f92aec4bb --- /dev/null +++ b/src/resources/generated/payment_method_konbini.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_konbini". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodKonbini { +} diff --git a/src/resources/generated/payment_method_link.rs b/src/resources/generated/payment_method_link.rs new file mode 100644 index 000000000..944a701ed --- /dev/null +++ b/src/resources/generated/payment_method_link.rs @@ -0,0 +1,17 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_link". +#[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, +} diff --git a/src/resources/generated/payment_method_mobilepay.rs b/src/resources/generated/payment_method_mobilepay.rs new file mode 100644 index 000000000..fb23914d6 --- /dev/null +++ b/src/resources/generated/payment_method_mobilepay.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_mobilepay". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodMobilepay { +} diff --git a/src/resources/generated/payment_method_multibanco.rs b/src/resources/generated/payment_method_multibanco.rs new file mode 100644 index 000000000..16c7f6d0d --- /dev/null +++ b/src/resources/generated/payment_method_multibanco.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_multibanco". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodMultibanco { +} diff --git a/src/resources/generated/payment_method_options_card_present_routing.rs b/src/resources/generated/payment_method_options_card_present_routing.rs new file mode 100644 index 000000000..59e7d3181 --- /dev/null +++ b/src/resources/generated/payment_method_options_card_present_routing.rs @@ -0,0 +1,47 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_options_card_present_routing". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodOptionsCardPresentRouting { + + /// Requested routing priority. + pub requested_priority: Option, +} + +/// An enum representing the possible values of an `PaymentMethodOptionsCardPresentRouting`'s `requested_priority` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentMethodOptionsCardPresentRoutingRequestedPriority { + Domestic, + International, +} + +impl PaymentMethodOptionsCardPresentRoutingRequestedPriority { + pub fn as_str(self) -> &'static str { + match self { + PaymentMethodOptionsCardPresentRoutingRequestedPriority::Domestic => "domestic", + PaymentMethodOptionsCardPresentRoutingRequestedPriority::International => "international", + } + } +} + +impl AsRef for PaymentMethodOptionsCardPresentRoutingRequestedPriority { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentMethodOptionsCardPresentRoutingRequestedPriority { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentMethodOptionsCardPresentRoutingRequestedPriority { + fn default() -> Self { + Self::Domestic + } +} diff --git a/src/resources/generated/payment_method_oxxo.rs b/src/resources/generated/payment_method_oxxo.rs new file mode 100644 index 000000000..be002edde --- /dev/null +++ b/src/resources/generated/payment_method_oxxo.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_oxxo". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodOxxo { +} diff --git a/src/resources/generated/payment_method_p24.rs b/src/resources/generated/payment_method_p24.rs new file mode 100644 index 000000000..20e916ae7 --- /dev/null +++ b/src/resources/generated/payment_method_p24.rs @@ -0,0 +1,95 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_p24". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodP24 { + + /// The customer's bank, if provided. + pub bank: Option, +} + +/// 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 + } +} diff --git a/src/resources/generated/payment_method_paynow.rs b/src/resources/generated/payment_method_paynow.rs new file mode 100644 index 000000000..9ee5210bf --- /dev/null +++ b/src/resources/generated/payment_method_paynow.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_paynow". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodPaynow { +} diff --git a/src/resources/generated/payment_method_paypal.rs b/src/resources/generated/payment_method_paypal.rs new file mode 100644 index 000000000..2b9346394 --- /dev/null +++ b/src/resources/generated/payment_method_paypal.rs @@ -0,0 +1,21 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_paypal". +#[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, +} diff --git a/src/resources/generated/payment_method_pix.rs b/src/resources/generated/payment_method_pix.rs new file mode 100644 index 000000000..3205208b8 --- /dev/null +++ b/src/resources/generated/payment_method_pix.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_pix". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodPix { +} diff --git a/src/resources/generated/payment_method_promptpay.rs b/src/resources/generated/payment_method_promptpay.rs new file mode 100644 index 000000000..4171ca54d --- /dev/null +++ b/src/resources/generated/payment_method_promptpay.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_promptpay". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodPromptpay { +} diff --git a/src/resources/generated/payment_method_revolut_pay.rs b/src/resources/generated/payment_method_revolut_pay.rs new file mode 100644 index 000000000..cbdebb288 --- /dev/null +++ b/src/resources/generated/payment_method_revolut_pay.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_revolut_pay". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodRevolutPay { +} diff --git a/src/resources/generated/payment_method_sepa_debit.rs b/src/resources/generated/payment_method_sepa_debit.rs new file mode 100644 index 000000000..be1debfeb --- /dev/null +++ b/src/resources/generated/payment_method_sepa_debit.rs @@ -0,0 +1,42 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::params::{Expandable}; +use crate::resources::{Charge, SetupAttempt}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_sepa_debit". +#[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 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/src/resources/generated/payment_method_sofort.rs b/src/resources/generated/payment_method_sofort.rs new file mode 100644 index 000000000..7c5587cac --- /dev/null +++ b/src/resources/generated/payment_method_sofort.rs @@ -0,0 +1,13 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_sofort". +#[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, +} diff --git a/src/resources/generated/payment_method_swish.rs b/src/resources/generated/payment_method_swish.rs new file mode 100644 index 000000000..2b2b24fc0 --- /dev/null +++ b/src/resources/generated/payment_method_swish.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_swish". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodSwish { +} diff --git a/src/resources/generated/payment_method_twint.rs b/src/resources/generated/payment_method_twint.rs new file mode 100644 index 000000000..89b275080 --- /dev/null +++ b/src/resources/generated/payment_method_twint.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_twint". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodTwint { +} diff --git a/src/resources/generated/payment_method_us_bank_account.rs b/src/resources/generated/payment_method_us_bank_account.rs new file mode 100644 index 000000000..7153b1ca4 --- /dev/null +++ b/src/resources/generated/payment_method_us_bank_account.rs @@ -0,0 +1,278 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_us_bank_account". +#[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 UsBankAccountNetworks { + + /// The preferred network. + pub preferred: Option, + + /// All supported networks. + pub supported: Vec, +} + +/// 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 `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 + } +} diff --git a/src/resources/generated/payment_method_wechat_pay.rs b/src/resources/generated/payment_method_wechat_pay.rs new file mode 100644 index 000000000..0de873239 --- /dev/null +++ b/src/resources/generated/payment_method_wechat_pay.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_wechat_pay". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodWechatPay { +} diff --git a/src/resources/generated/payment_method_zip.rs b/src/resources/generated/payment_method_zip.rs new file mode 100644 index 000000000..c37a2961b --- /dev/null +++ b/src/resources/generated/payment_method_zip.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_zip". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodZip { +} diff --git a/src/resources/generated/payout.rs b/src/resources/generated/payout.rs index a1da275c9..dd049b72c 100644 --- a/src/resources/generated/payout.rs +++ b/src/resources/generated/payout.rs @@ -7,7 +7,7 @@ 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}; +use crate::resources::{ApplicationFee, BalanceTransaction, Currency, PayoutDestinationUnion}; /// The resource representing a Stripe "Payout". /// @@ -20,6 +20,16 @@ pub struct Payout { /// The amount (in cents (or local equivalent)) that transfers to your bank account or debit card. pub amount: i64, + /// The application fee (if any) for the payout. + /// + /// [See the Connect documentation](https://stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details. + pub application_fee: Option>, + + /// The amount of the application fee (if any) requested for the payout. + /// + /// [See the Connect documentation](https://stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details. + pub application_fee_amount: Option, + /// Date that you can expect the payout to arrive in the bank. /// /// This factors in delays to account for weekends or bank holidays. @@ -225,9 +235,11 @@ impl<'a> CreatePayout<'a> { /// The parameters for `Payout::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListPayouts<'a> { + /// Only return payouts that are expected to arrive during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub arrival_date: Option>, + /// Only return payouts that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, diff --git a/src/resources/generated/person.rs b/src/resources/generated/person.rs index 7ff2c6507..ea0e28dee 100644 --- a/src/resources/generated/person.rs +++ b/src/resources/generated/person.rs @@ -210,7 +210,8 @@ pub struct PersonVerificationDocument { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PersonAdditionalTosAcceptances { - pub account: PersonAdditionalTosAcceptance, + /// Details on the legal guardian's acceptance of the main Stripe service agreement. + pub account: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -249,10 +250,11 @@ pub struct PersonFutureRequirements { /// 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. + /// Fields that might become required depending on the results of verification or review. /// - /// Will be an empty array unless an asynchronous verification is pending. + /// It's an empty array unless an asynchronous verification is pending. /// If verification fails, these fields move to `eventually_due` or `currently_due`. + /// Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. pub pending_verification: Vec, } @@ -330,10 +332,11 @@ pub struct PersonRequirements { /// 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. + /// Fields that might become required depending on the results of verification or review. /// - /// Will be an empty array unless an asynchronous verification is pending. + /// It's an empty array unless an asynchronous verification is pending. /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + /// Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. pub pending_verification: Vec, } @@ -422,6 +425,7 @@ pub enum AccountRequirementsErrorCode { VerificationFailedKeyedMatch, VerificationFailedNameMatch, VerificationFailedOther, + VerificationFailedRepresentativeAuthority, VerificationFailedResidentialAddress, VerificationFailedTaxIdMatch, VerificationFailedTaxIdNotIssued, @@ -429,6 +433,8 @@ pub enum AccountRequirementsErrorCode { VerificationMissingExecutives, VerificationMissingOwners, VerificationRequiresAdditionalMemorandumOfAssociations, + VerificationRequiresAdditionalProofOfRegistration, + VerificationSupportability, } impl AccountRequirementsErrorCode { @@ -514,6 +520,7 @@ impl AccountRequirementsErrorCode { AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", + AccountRequirementsErrorCode::VerificationFailedRepresentativeAuthority => "verification_failed_representative_authority", AccountRequirementsErrorCode::VerificationFailedResidentialAddress => "verification_failed_residential_address", AccountRequirementsErrorCode::VerificationFailedTaxIdMatch => "verification_failed_tax_id_match", AccountRequirementsErrorCode::VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued", @@ -521,6 +528,8 @@ impl AccountRequirementsErrorCode { AccountRequirementsErrorCode::VerificationMissingExecutives => "verification_missing_executives", AccountRequirementsErrorCode::VerificationMissingOwners => "verification_missing_owners", AccountRequirementsErrorCode::VerificationRequiresAdditionalMemorandumOfAssociations => "verification_requires_additional_memorandum_of_associations", + AccountRequirementsErrorCode::VerificationRequiresAdditionalProofOfRegistration => "verification_requires_additional_proof_of_registration", + AccountRequirementsErrorCode::VerificationSupportability => "verification_supportability", } } } diff --git a/src/resources/generated/plan.rs b/src/resources/generated/plan.rs index ac57f6243..46598e2df 100644 --- a/src/resources/generated/plan.rs +++ b/src/resources/generated/plan.rs @@ -89,6 +89,10 @@ pub struct Plan { #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, + /// The meter tracking the usage of a metered price. + #[serde(skip_serializing_if = "Option::is_none")] + pub meter: Option, + /// A brief description of the plan, hidden from customers. #[serde(skip_serializing_if = "Option::is_none")] pub nickname: Option, 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 index 9e58d97f6..bf345e527 100644 --- a/src/resources/generated/price.rs +++ b/src/resources/generated/price.rs @@ -237,6 +237,9 @@ pub struct Recurring { /// For example, `interval=month` and `interval_count=3` bills every 3 months. pub interval_count: u64, + /// The meter tracking the usage of a metered price. + pub meter: 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). pub trial_period_days: Option, @@ -357,7 +360,7 @@ pub struct CreatePrice<'a> { /// 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`. + /// One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required, unless `billing_scheme=tiered`. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount: Option, @@ -429,6 +432,8 @@ pub struct ListPrices<'a> { pub limit: Option, /// Only return the price with these lookup_keys, if any exist. + /// + /// You can specify up to 10 lookup_keys. #[serde(skip_serializing_if = "Option::is_none")] pub lookup_keys: Option>, @@ -658,6 +663,10 @@ pub struct CreatePriceRecurring { #[serde(skip_serializing_if = "Option::is_none")] pub interval_count: Option, + /// The meter tracking the usage of a metered price. + #[serde(skip_serializing_if = "Option::is_none")] + pub meter: 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, @@ -718,6 +727,10 @@ pub struct ListPricesRecurring { #[serde(skip_serializing_if = "Option::is_none")] pub interval: Option, + /// Filter by the price's meter. + #[serde(skip_serializing_if = "Option::is_none")] + pub meter: Option, + /// Filter by the usage type for this price. /// /// Can be either `metered` or `licensed`. diff --git a/src/resources/generated/product.rs b/src/resources/generated/product.rs index 3ed50337d..c022de6f5 100644 --- a/src/resources/generated/product.rs +++ b/src/resources/generated/product.rs @@ -44,12 +44,6 @@ pub struct Product { #[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. #[serde(skip_serializing_if = "Option::is_none")] pub images: Option>, @@ -58,6 +52,12 @@ pub struct Product { #[serde(skip_serializing_if = "Option::is_none")] pub livemode: Option, + /// A list of up to 15 marketing 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 marketing_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. @@ -79,6 +79,7 @@ pub struct Product { /// 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. + /// Only used for subscription payments. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor: Option, @@ -174,8 +175,8 @@ pub struct PackageDimensions { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ProductFeature { - /// The feature's name. +pub struct ProductMarketingFeature { + /// The marketing feature name. /// /// Up to 80 characters long. #[serde(skip_serializing_if = "Option::is_none")] @@ -207,12 +208,6 @@ pub struct CreateProduct<'a> { #[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>, - /// 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. @@ -223,6 +218,12 @@ pub struct CreateProduct<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub images: Option>, + /// A list of up to 15 marketing 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 marketing_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. @@ -247,6 +248,7 @@ pub struct CreateProduct<'a> { /// 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. + /// Only used for subscription payments. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor: Option<&'a str>, @@ -281,9 +283,9 @@ impl<'a> CreateProduct<'a> { default_price_data: Default::default(), description: Default::default(), expand: Default::default(), - features: Default::default(), id: Default::default(), images: Default::default(), + marketing_features: Default::default(), metadata: Default::default(), name, package_dimensions: Default::default(), @@ -395,16 +397,16 @@ pub struct UpdateProduct<'a> { #[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>, + /// A list of up to 15 marketing 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 marketing_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. @@ -431,6 +433,7 @@ pub struct UpdateProduct<'a> { /// 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`. + /// Only used for subscription payments. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor: Option<&'a str>, @@ -457,8 +460,8 @@ impl<'a> UpdateProduct<'a> { default_price: Default::default(), description: Default::default(), expand: Default::default(), - features: Default::default(), images: Default::default(), + marketing_features: Default::default(), metadata: Default::default(), name: Default::default(), package_dimensions: Default::default(), @@ -484,6 +487,10 @@ pub struct CreateProductDefaultPriceData { #[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, + /// The recurring components of a price such as `interval` and `interval_count`. #[serde(skip_serializing_if = "Option::is_none")] pub recurring: Option, @@ -498,7 +505,7 @@ pub struct CreateProductDefaultPriceData { /// 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. + /// One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount: Option, @@ -510,16 +517,16 @@ pub struct CreateProductDefaultPriceData { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateProductFeatures { - /// The feature's name. +pub struct CreateProductMarketingFeatures { + /// The marketing feature name. /// /// Up to 80 characters long. pub name: String, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateProductFeatures { - /// The feature's name. +pub struct UpdateProductMarketingFeatures { + /// The marketing feature name. /// /// Up to 80 characters long. pub name: String, @@ -557,6 +564,26 @@ pub struct CreateProductDefaultPriceDataCurrencyOptions { pub unit_amount_decimal: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateProductDefaultPriceDataCustomUnitAmount { + /// 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 CreateProductDefaultPriceDataRecurring { /// Specifies billing frequency. diff --git a/src/resources/generated/product_feature.rs b/src/resources/generated/product_feature.rs new file mode 100644 index 000000000..f993e5cf2 --- /dev/null +++ b/src/resources/generated/product_feature.rs @@ -0,0 +1,38 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{ProductFeatureId}; +use crate::params::{Object}; +use crate::resources::{EntitlementsFeature}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "ProductFeature". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ProductFeature { + /// Unique identifier for the object. + pub id: ProductFeatureId, + + // Always true for a deleted object + #[serde(default)] + pub deleted: bool, + + #[serde(skip_serializing_if = "Option::is_none")] + pub entitlement_feature: 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 ProductFeature { + type Id = ProductFeatureId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "product_feature" + } +} diff --git a/src/resources/generated/promotion_code.rs b/src/resources/generated/promotion_code.rs index f781df8ab..f1b63a8ff 100644 --- a/src/resources/generated/promotion_code.rs +++ b/src/resources/generated/promotion_code.rs @@ -27,6 +27,7 @@ pub struct PromotionCode { /// The customer-facing code. /// /// Regardless of case, this code must be unique across all active promotion codes for each customer. + /// Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9). pub code: String, pub coupon: Coupon, diff --git a/src/resources/generated/refund.rs b/src/resources/generated/refund.rs index f91a9b9a9..3df739e9f 100644 --- a/src/resources/generated/refund.rs +++ b/src/resources/generated/refund.rs @@ -96,7 +96,8 @@ pub struct Refund { 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. + /// 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", params) } @@ -152,6 +153,9 @@ pub struct RefundDestinationDetails { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub au_bank_transfer: Option, @@ -191,6 +195,9 @@ pub struct RefundDestinationDetails { #[serde(skip_serializing_if = "Option::is_none")] pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub mx_bank_transfer: Option, @@ -391,6 +398,7 @@ pub struct ListRefunds<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub charge: Option, + /// Only return refunds that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, diff --git a/src/resources/generated/review.rs b/src/resources/generated/review.rs index 85e11b7e2..96eeb7042 100644 --- a/src/resources/generated/review.rs +++ b/src/resources/generated/review.rs @@ -125,6 +125,7 @@ pub struct RadarReviewResourceSession { /// The parameters for `Review::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListReviews<'a> { + /// Only return reviews that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, diff --git a/src/resources/generated/setup_attempt.rs b/src/resources/generated/setup_attempt.rs index d1ac95b81..8b34f3e89 100644 --- a/src/resources/generated/setup_attempt.rs +++ b/src/resources/generated/setup_attempt.rs @@ -9,7 +9,8 @@ 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, + PaymentMethodDetailsCardPresentOffline, PaymentMethodDetailsCardWalletApplePay, + PaymentMethodDetailsCardWalletGooglePay, SetupIntent, }; /// The resource representing a Stripe "PaymentFlowsSetupIntentSetupAttempt". @@ -93,6 +94,9 @@ pub struct SetupAttemptPaymentMethodDetails { #[serde(skip_serializing_if = "Option::is_none")] pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub au_becs_debit: Option, @@ -126,6 +130,9 @@ pub struct SetupAttemptPaymentMethodDetails { #[serde(skip_serializing_if = "Option::is_none")] pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub sepa_debit: Option, @@ -146,6 +153,9 @@ pub struct SetupAttemptPaymentMethodDetails { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupAttemptPaymentMethodDetailsAcssDebit {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SetupAttemptPaymentMethodDetailsAmazonPay {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupAttemptPaymentMethodDetailsAuBecsDebit {} @@ -268,6 +278,9 @@ pub struct SetupAttemptPaymentMethodDetailsCardChecks { pub struct SetupAttemptPaymentMethodDetailsCardPresent { /// The ID of the Card PaymentMethod which was generated by this SetupAttempt. pub generated_card: Option>, + + /// Details about payments collected offline. + pub offline: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -324,6 +337,9 @@ pub struct SetupAttemptPaymentMethodDetailsLink {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupAttemptPaymentMethodDetailsPaypal {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SetupAttemptPaymentMethodDetailsRevolutPay {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupAttemptPaymentMethodDetailsSepaDebit {} diff --git a/src/resources/generated/setup_intent.rs b/src/resources/generated/setup_intent.rs index bf16a0048..ab0af1363 100644 --- a/src/resources/generated/setup_intent.rs +++ b/src/resources/generated/setup_intent.rs @@ -5,7 +5,9 @@ use serde::{Deserialize, Serialize}; use crate::client::{Client, Response}; -use crate::ids::{CustomerId, PaymentMethodConfigurationId, PaymentMethodId, SetupIntentId}; +use crate::ids::{ + ConfirmationTokenId, CustomerId, PaymentMethodConfigurationId, PaymentMethodId, SetupIntentId, +}; use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; use crate::resources::{ Account, ApiErrors, Application, Currency, Customer, LinkedAccountOptionsUsBankAccount, @@ -95,6 +97,8 @@ pub struct SetupIntent { pub on_behalf_of: Option>, /// ID of the payment method used with this SetupIntent. + /// + /// If the payment method is `card_present` and isn't a digital wallet, then the [generated_card](https://docs.stripe.com/api/setup_attempts/object#setup_attempt_object-payment_method_details-card_present-generated_card) associated with the `latest_attempt` is attached to the Customer instead. pub payment_method: Option>, /// Information about the payment method configuration used for this Setup Intent. @@ -234,9 +238,18 @@ pub struct SetupIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: 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 card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, @@ -263,6 +276,15 @@ pub struct SetupIntentPaymentMethodOptionsAcssDebit { pub verification_method: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SetupIntentPaymentMethodOptionsAmazonPay {} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SetupIntentPaymentMethodOptionsBacsDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupIntentPaymentMethodOptionsCard { /// Configuration options for setting up an eMandate for cards issued in India. @@ -278,7 +300,7 @@ pub struct SetupIntentPaymentMethodOptionsCard { /// /// 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. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. pub request_three_d_secure: Option, } @@ -334,6 +356,9 @@ pub struct SetupIntentPaymentMethodOptionsCardMandateOptions { Option>, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SetupIntentPaymentMethodOptionsCardPresent {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupIntentPaymentMethodOptionsLink { /// [Deprecated] This is a legacy parameter that no longer has any function. @@ -364,6 +389,9 @@ pub struct SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SetupIntentPaymentMethodOptionsMandateOptionsBacsDebit {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupIntentPaymentMethodOptionsPaypal { /// The PayPal Billing Agreement ID (BAID). @@ -416,6 +444,12 @@ pub struct CreateSetupIntent<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub confirm: Option, + /// ID of the ConfirmationToken used to confirm this SetupIntent. + /// + /// If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_token: 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. @@ -506,6 +540,7 @@ impl<'a> CreateSetupIntent<'a> { attach_to_self: Default::default(), automatic_payment_methods: Default::default(), confirm: Default::default(), + confirmation_token: Default::default(), customer: Default::default(), description: Default::default(), expand: Default::default(), @@ -642,6 +677,8 @@ pub struct UpdateSetupIntent<'a> { pub metadata: Option, /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + /// + /// To unset this field to null, pass in an empty string. #[serde(skip_serializing_if = "Option::is_none")] pub payment_method: Option, @@ -721,6 +758,17 @@ pub struct CreateSetupIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + /// This field indicates whether this payment method can be shown again to its customer in a checkout flow. + /// + /// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + /// The field defaults to `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redisplay: Option, + + /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: 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, @@ -797,6 +845,14 @@ pub struct CreateSetupIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, + /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + + /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: 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, @@ -843,6 +899,10 @@ pub struct CreateSetupIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub swish: Option, + /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: Option, + /// The type of the PaymentMethod. /// /// An additional hash is included on the PaymentMethod with a name matching this value. @@ -869,10 +929,22 @@ pub struct CreateSetupIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub acss_debit: Option, + /// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + + /// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_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 `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 `link` PaymentMethod, this sub-hash contains details about the Link payment method options. #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, @@ -923,6 +995,17 @@ pub struct UpdateSetupIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub alipay: Option, + /// This field indicates whether this payment method can be shown again to its customer in a checkout flow. + /// + /// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + /// The field defaults to `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redisplay: Option, + + /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: 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, @@ -999,6 +1082,14 @@ pub struct UpdateSetupIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, + /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub mobilepay: Option, + + /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: 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, @@ -1045,6 +1136,10 @@ pub struct UpdateSetupIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub swish: Option, + /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub twint: Option, + /// The type of the PaymentMethod. /// /// An additional hash is included on the PaymentMethod with a name matching this value. @@ -1071,10 +1166,22 @@ pub struct UpdateSetupIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub acss_debit: Option, + /// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub amazon_pay: Option, + + /// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_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 `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 `link` PaymentMethod, this sub-hash contains details about the Link payment method options. #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, @@ -1134,6 +1241,9 @@ pub struct CreateSetupIntentPaymentMethodDataAfterpayClearpay {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodDataAlipay {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSetupIntentPaymentMethodDataAmazonPay {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodDataAuBecsDebit { /// The account number for the bank account. @@ -1239,6 +1349,12 @@ pub struct CreateSetupIntentPaymentMethodDataKonbini {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodDataLink {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSetupIntentPaymentMethodDataMobilepay {} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSetupIntentPaymentMethodDataMultibanco {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodDataOxxo {} @@ -1286,6 +1402,9 @@ pub struct CreateSetupIntentPaymentMethodDataSofort { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodDataSwish {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSetupIntentPaymentMethodDataTwint {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodDataUsBankAccount { /// Account holder type: individual or company. @@ -1336,6 +1455,16 @@ pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsAmazonPay {} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsBacsDebit { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodOptionsCard { /// Configuration options for setting up an eMandate for cards issued in India. @@ -1360,7 +1489,7 @@ pub struct CreateSetupIntentPaymentMethodOptionsCard { /// /// 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. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#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, @@ -1371,6 +1500,9 @@ pub struct CreateSetupIntentPaymentMethodOptionsCard { pub three_d_secure: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsCardPresent {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodOptionsLink { /// [Deprecated] This is a legacy parameter that no longer has any function. @@ -1436,6 +1568,9 @@ pub struct UpdateSetupIntentPaymentMethodDataAfterpayClearpay {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodDataAlipay {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataAmazonPay {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit { /// The account number for the bank account. @@ -1541,6 +1676,12 @@ pub struct UpdateSetupIntentPaymentMethodDataKonbini {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodDataLink {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataMobilepay {} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataMultibanco {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodDataOxxo {} @@ -1588,6 +1729,9 @@ pub struct UpdateSetupIntentPaymentMethodDataSofort { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodDataSwish {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataTwint {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount { /// Account holder type: individual or company. @@ -1638,6 +1782,16 @@ pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsAmazonPay {} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsBacsDebit { + /// Additional fields for Mandate creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodOptionsCard { /// Configuration options for setting up an eMandate for cards issued in India. @@ -1662,7 +1816,7 @@ pub struct UpdateSetupIntentPaymentMethodOptionsCard { /// /// 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. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#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, @@ -1673,6 +1827,9 @@ pub struct UpdateSetupIntentPaymentMethodOptionsCard { pub three_d_secure: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsCardPresent {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodOptionsLink { /// [Deprecated] This is a legacy parameter that no longer has any function. @@ -1798,6 +1955,9 @@ pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsBacsDebitMandateOptions {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions { /// Amount to be charged for future payments. @@ -1906,6 +2066,11 @@ pub struct CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections { + /// Provide filters for the linked accounts that the customer can select for the payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: + Option, + /// The list of permissions to request. /// /// If this parameter is passed, the `payment_method` permission must be included. @@ -2011,6 +2176,9 @@ pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsBacsDebitMandateOptions {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions { /// Amount to be charged for future payments. @@ -2119,6 +2287,11 @@ pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections { + /// Provide filters for the linked accounts that the customer can select for the payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: + Option, + /// The list of permissions to request. /// /// If this parameter is passed, the `payment_method` permission must be included. @@ -2163,6 +2336,16 @@ pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters { + + /// The account subcategories to use to filter for selectable accounts. + /// + /// Valid subcategories are `checking` and `savings`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_subcategories: Option>, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions { /// Cartes Bancaires-specific 3DS fields. @@ -2171,6 +2354,16 @@ pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters { + + /// The account subcategories to use to filter for selectable accounts. + /// + /// Valid subcategories are `checking` and `savings`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_subcategories: Option>, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires { /// The cryptogram calculation algorithm used by the card Issuer's ACS @@ -2317,6 +2510,42 @@ impl std::default::Default for CreateSetupIntentMandateDataCustomerAcceptanceTyp } } +/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodData`'s `allow_redisplay` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateSetupIntentPaymentMethodDataAllowRedisplay { + Always, + Limited, + Unspecified, +} + +impl CreateSetupIntentPaymentMethodDataAllowRedisplay { + pub fn as_str(self) -> &'static str { + match self { + CreateSetupIntentPaymentMethodDataAllowRedisplay::Always => "always", + CreateSetupIntentPaymentMethodDataAllowRedisplay::Limited => "limited", + CreateSetupIntentPaymentMethodDataAllowRedisplay::Unspecified => "unspecified", + } + } +} + +impl AsRef for CreateSetupIntentPaymentMethodDataAllowRedisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataAllowRedisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateSetupIntentPaymentMethodDataAllowRedisplay { + fn default() -> Self { + Self::Always + } +} + /// 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")] @@ -2741,6 +2970,7 @@ pub enum CreateSetupIntentPaymentMethodDataType { Affirm, AfterpayClearpay, Alipay, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -2756,6 +2986,8 @@ pub enum CreateSetupIntentPaymentMethodDataType { Klarna, Konbini, Link, + Mobilepay, + Multibanco, Oxxo, P24, Paynow, @@ -2766,6 +2998,7 @@ pub enum CreateSetupIntentPaymentMethodDataType { SepaDebit, Sofort, Swish, + Twint, UsBankAccount, WechatPay, Zip, @@ -2778,6 +3011,7 @@ impl CreateSetupIntentPaymentMethodDataType { CreateSetupIntentPaymentMethodDataType::Affirm => "affirm", CreateSetupIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", CreateSetupIntentPaymentMethodDataType::Alipay => "alipay", + CreateSetupIntentPaymentMethodDataType::AmazonPay => "amazon_pay", CreateSetupIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", CreateSetupIntentPaymentMethodDataType::BacsDebit => "bacs_debit", CreateSetupIntentPaymentMethodDataType::Bancontact => "bancontact", @@ -2793,6 +3027,8 @@ impl CreateSetupIntentPaymentMethodDataType { CreateSetupIntentPaymentMethodDataType::Klarna => "klarna", CreateSetupIntentPaymentMethodDataType::Konbini => "konbini", CreateSetupIntentPaymentMethodDataType::Link => "link", + CreateSetupIntentPaymentMethodDataType::Mobilepay => "mobilepay", + CreateSetupIntentPaymentMethodDataType::Multibanco => "multibanco", CreateSetupIntentPaymentMethodDataType::Oxxo => "oxxo", CreateSetupIntentPaymentMethodDataType::P24 => "p24", CreateSetupIntentPaymentMethodDataType::Paynow => "paynow", @@ -2803,6 +3039,7 @@ impl CreateSetupIntentPaymentMethodDataType { CreateSetupIntentPaymentMethodDataType::SepaDebit => "sepa_debit", CreateSetupIntentPaymentMethodDataType::Sofort => "sofort", CreateSetupIntentPaymentMethodDataType::Swish => "swish", + CreateSetupIntentPaymentMethodDataType::Twint => "twint", CreateSetupIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", CreateSetupIntentPaymentMethodDataType::WechatPay => "wechat_pay", CreateSetupIntentPaymentMethodDataType::Zip => "zip", @@ -3168,6 +3405,7 @@ pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork { Diners, Discover, EftposAu, + Girocard, Interac, Jcb, Mastercard, @@ -3184,6 +3422,7 @@ impl CreateSetupIntentPaymentMethodOptionsCardNetwork { CreateSetupIntentPaymentMethodOptionsCardNetwork::Diners => "diners", CreateSetupIntentPaymentMethodOptionsCardNetwork::Discover => "discover", CreateSetupIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", + CreateSetupIntentPaymentMethodOptionsCardNetwork::Girocard => "girocard", CreateSetupIntentPaymentMethodOptionsCardNetwork::Interac => "interac", CreateSetupIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", CreateSetupIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", @@ -3445,6 +3684,41 @@ impl std::default::Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSe } } +/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`'s `account_subcategories` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories +{ + Checking, + Savings, +} + +impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + pub fn as_str(self) -> &'static str { + match self { + CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Checking => "checking", + CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Savings => "savings", + } + } +} + +impl AsRef for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn default() -> Self { + Self::Checking + } +} + /// 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")] @@ -3494,6 +3768,7 @@ impl std::default::Default #[serde(rename_all = "snake_case")] pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { Balances, + Ownership, Transactions, } @@ -3501,6 +3776,7 @@ impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefe pub fn as_str(self) -> &'static str { match self { CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", + CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Ownership => "ownership", CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", } } @@ -3938,6 +4214,7 @@ pub enum SetupIntentPaymentMethodOptionsCardNetwork { Diners, Discover, EftposAu, + Girocard, Interac, Jcb, Mastercard, @@ -3954,6 +4231,7 @@ impl SetupIntentPaymentMethodOptionsCardNetwork { SetupIntentPaymentMethodOptionsCardNetwork::Diners => "diners", SetupIntentPaymentMethodOptionsCardNetwork::Discover => "discover", SetupIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", + SetupIntentPaymentMethodOptionsCardNetwork::Girocard => "girocard", SetupIntentPaymentMethodOptionsCardNetwork::Interac => "interac", SetupIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", SetupIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", @@ -4253,6 +4531,42 @@ impl std::default::Default for UpdateSetupIntentFlowDirections { } } +/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodData`'s `allow_redisplay` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdateSetupIntentPaymentMethodDataAllowRedisplay { + Always, + Limited, + Unspecified, +} + +impl UpdateSetupIntentPaymentMethodDataAllowRedisplay { + pub fn as_str(self) -> &'static str { + match self { + UpdateSetupIntentPaymentMethodDataAllowRedisplay::Always => "always", + UpdateSetupIntentPaymentMethodDataAllowRedisplay::Limited => "limited", + UpdateSetupIntentPaymentMethodDataAllowRedisplay::Unspecified => "unspecified", + } + } +} + +impl AsRef for UpdateSetupIntentPaymentMethodDataAllowRedisplay { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataAllowRedisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdateSetupIntentPaymentMethodDataAllowRedisplay { + fn default() -> Self { + Self::Always + } +} + /// 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")] @@ -4677,6 +4991,7 @@ pub enum UpdateSetupIntentPaymentMethodDataType { Affirm, AfterpayClearpay, Alipay, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -4692,6 +5007,8 @@ pub enum UpdateSetupIntentPaymentMethodDataType { Klarna, Konbini, Link, + Mobilepay, + Multibanco, Oxxo, P24, Paynow, @@ -4702,6 +5019,7 @@ pub enum UpdateSetupIntentPaymentMethodDataType { SepaDebit, Sofort, Swish, + Twint, UsBankAccount, WechatPay, Zip, @@ -4714,6 +5032,7 @@ impl UpdateSetupIntentPaymentMethodDataType { UpdateSetupIntentPaymentMethodDataType::Affirm => "affirm", UpdateSetupIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", UpdateSetupIntentPaymentMethodDataType::Alipay => "alipay", + UpdateSetupIntentPaymentMethodDataType::AmazonPay => "amazon_pay", UpdateSetupIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", UpdateSetupIntentPaymentMethodDataType::BacsDebit => "bacs_debit", UpdateSetupIntentPaymentMethodDataType::Bancontact => "bancontact", @@ -4729,6 +5048,8 @@ impl UpdateSetupIntentPaymentMethodDataType { UpdateSetupIntentPaymentMethodDataType::Klarna => "klarna", UpdateSetupIntentPaymentMethodDataType::Konbini => "konbini", UpdateSetupIntentPaymentMethodDataType::Link => "link", + UpdateSetupIntentPaymentMethodDataType::Mobilepay => "mobilepay", + UpdateSetupIntentPaymentMethodDataType::Multibanco => "multibanco", UpdateSetupIntentPaymentMethodDataType::Oxxo => "oxxo", UpdateSetupIntentPaymentMethodDataType::P24 => "p24", UpdateSetupIntentPaymentMethodDataType::Paynow => "paynow", @@ -4739,6 +5060,7 @@ impl UpdateSetupIntentPaymentMethodDataType { UpdateSetupIntentPaymentMethodDataType::SepaDebit => "sepa_debit", UpdateSetupIntentPaymentMethodDataType::Sofort => "sofort", UpdateSetupIntentPaymentMethodDataType::Swish => "swish", + UpdateSetupIntentPaymentMethodDataType::Twint => "twint", UpdateSetupIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", UpdateSetupIntentPaymentMethodDataType::WechatPay => "wechat_pay", UpdateSetupIntentPaymentMethodDataType::Zip => "zip", @@ -5104,6 +5426,7 @@ pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork { Diners, Discover, EftposAu, + Girocard, Interac, Jcb, Mastercard, @@ -5120,6 +5443,7 @@ impl UpdateSetupIntentPaymentMethodOptionsCardNetwork { UpdateSetupIntentPaymentMethodOptionsCardNetwork::Diners => "diners", UpdateSetupIntentPaymentMethodOptionsCardNetwork::Discover => "discover", UpdateSetupIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", + UpdateSetupIntentPaymentMethodOptionsCardNetwork::Girocard => "girocard", UpdateSetupIntentPaymentMethodOptionsCardNetwork::Interac => "interac", UpdateSetupIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", UpdateSetupIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", @@ -5381,6 +5705,41 @@ impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSe } } +/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`'s `account_subcategories` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories +{ + Checking, + Savings, +} + +impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + pub fn as_str(self) -> &'static str { + match self { + UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Checking => "checking", + UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Savings => "savings", + } + } +} + +impl AsRef for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn default() -> Self { + Self::Checking + } +} + /// 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")] @@ -5430,6 +5789,7 @@ impl std::default::Default #[serde(rename_all = "snake_case")] pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { Balances, + Ownership, Transactions, } @@ -5437,6 +5797,7 @@ impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefe pub fn as_str(self) -> &'static str { match self { UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", + UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Ownership => "ownership", UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", } } diff --git a/src/resources/generated/shipping_rate.rs b/src/resources/generated/shipping_rate.rs index 6f77c617a..0a3c825b6 100644 --- a/src/resources/generated/shipping_rate.rs +++ b/src/resources/generated/shipping_rate.rs @@ -61,8 +61,6 @@ pub struct ShippingRate { 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, } @@ -204,8 +202,6 @@ pub struct CreateShippingRate<'a> { 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, diff --git a/src/resources/generated/subscription.rs b/src/resources/generated/subscription.rs index 584b44d6d..232d2118c 100644 --- a/src/resources/generated/subscription.rs +++ b/src/resources/generated/subscription.rs @@ -13,10 +13,10 @@ 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, + InvoicePaymentMethodOptionsSepaDebit, InvoicePaymentMethodOptionsUsBankAccount, PaymentMethod, + PaymentSource, Scheduled, SetupIntent, SubscriptionBillingThresholds, SubscriptionItem, + SubscriptionItemBillingThresholds, SubscriptionSchedule, SubscriptionTransferData, + SubscriptionsTrialsResourceTrialSettings, TaxId, TaxRate, TestHelpersTestClock, }; /// The resource representing a Stripe "Subscription". @@ -52,9 +52,7 @@ pub struct Subscription { /// 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. + /// Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. pub cancel_at_period_end: bool, /// If the subscription has been canceled, the date of that cancellation. @@ -125,11 +123,21 @@ pub struct Subscription { /// 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. + /// This field has been deprecated and will be removed in a future API version. + /// Use `discounts` instead. pub discount: Option, + /// The discounts applied to the subscription. + /// + /// Subscription item discounts are applied before subscription discounts. + /// Use `expand[]=discounts` to expand each discount. + pub discounts: Vec>, + /// If the subscription has ended, the date the subscription ended. pub ended_at: Option, + pub invoice_settings: SubscriptionsResourceSubscriptionInvoiceSettings, + /// List of subscription items, each with an attached price. pub items: List, @@ -153,6 +161,9 @@ pub struct Subscription { pub on_behalf_of: Option>, /// If specified, payment collection for this subscription will be paused. + /// + /// Note that the subscription status will be unchanged and will not be updated to `paused`. + /// Learn more about [pausing collection](/billing/subscriptions/pause-payment). pub pause_collection: Option, /// Payment settings passed on to invoices created by the subscription. @@ -179,14 +190,17 @@ pub struct Subscription { /// 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`. + /// Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, or `paused`. /// /// 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. + /// A subscription in this status can only have metadata and default_source updated. + /// Once the first invoice is paid, the subscription moves into an `active` status. /// 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. + /// This is a terminal status, 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. + /// A subscription can only enter a `paused` status [when a trial ends without a payment method](/billing/subscriptions/trials#create-free-trials-without-payment). + /// A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. + /// The `paused` status is different from [pausing collection](/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. /// 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. @@ -237,14 +251,15 @@ impl Subscription { /// 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. + /// To preview how the proration is calculated, use the [create preview](https://stripe.com/docs/api/invoices/create_preview) 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. + /// 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.
  • 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. + /// Learn about how Stripe immediately attempts payment for subscription changes. 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. @@ -262,9 +277,10 @@ impl Subscription { /// 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. + /// The customer won’t be charged again for the subscription. + /// After it’s canceled, you can no longer update the subscription or its metadata. Any pending invoice items that you’ve created are still charged 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 are also left in place and collected at the end of the period. + /// But if the subscription is set to cancel immediately, pending prorations are removed. By default, upon subscription cancellation, Stripe stops 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. @@ -360,9 +376,9 @@ pub struct SubscriptionsResourcePaymentSettings { /// 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`. + /// Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. /// - /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + /// Defaults to `off`. pub save_default_payment_method: Option, } @@ -384,6 +400,9 @@ pub struct SubscriptionsResourcePaymentMethodOptions { /// 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 SEPA Direct Debit payment method options to pass to invoices created by the subscription. + pub sepa_debit: 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, } @@ -402,7 +421,7 @@ pub struct SubscriptionPaymentMethodOptionsCard { /// 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. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. pub request_three_d_secure: Option, } @@ -445,6 +464,16 @@ pub struct SubscriptionsResourcePendingUpdate { pub trial_from_plan: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SubscriptionsResourceSubscriptionInvoiceSettings { + /// The account tax IDs associated with the subscription. + /// + /// Will be set on invoices generated by the subscription. + pub account_tax_ids: Option>>, + + pub issuer: ConnectAccountReference, +} + /// The parameters for `Subscription::create`. #[derive(Clone, Debug, Serialize)] pub struct CreateSubscription<'a> { @@ -501,7 +530,9 @@ pub struct CreateSubscription<'a> { #[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. + /// Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). + /// + /// Defaults to `false`. #[serde(skip_serializing_if = "Option::is_none")] pub cancel_at_period_end: Option, @@ -516,6 +547,8 @@ pub struct CreateSubscription<'a> { /// 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. + /// This field has been deprecated and will be removed in a future API version. + /// Use `discounts` instead. #[serde(skip_serializing_if = "Option::is_none")] pub coupon: Option, @@ -562,6 +595,12 @@ pub struct CreateSubscription<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub description: Option<&'a str>, + /// The coupons to redeem into discounts for the subscription. + /// + /// If not specified or empty, inherits the discount from the subscription's customer. + #[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], @@ -583,6 +622,8 @@ pub struct CreateSubscription<'a> { pub metadata: Option, /// Indicates if a customer is on or off-session while an invoice payment is attempted. + /// + /// Defaults to `false` (on-session). #[serde(skip_serializing_if = "Option::is_none")] pub off_session: Option, @@ -592,19 +633,18 @@ pub struct CreateSubscription<'a> { /// 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. + /// Use `allow_incomplete` to create Subscriptions with `status=incomplete` if the first invoice can't be paid. /// - /// Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. + /// Creating Subscriptions with this status allows you to manage scenarios where additional customer 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. + /// Subscriptions transition to `status=active` when successfully confirming the PaymentIntent on the first invoice. + /// This allows simpler management of scenarios where additional customer 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 PaymentIntent 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 can't be paid. + /// For example, if a payment method requires 3DS authentication due to SCA regulation and further customer action is needed, this parameter doesn't 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. + /// 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, @@ -618,13 +658,15 @@ pub struct CreateSubscription<'a> { #[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. + /// The promotion code to apply to this subscription. /// /// A promotion code applied to a subscription will only affect invoices created for that particular subscription. + /// This field has been deprecated and will be removed in a future API version. + /// Use `discounts` instead. #[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`. + /// Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. /// /// If no value is passed, the default is `create_prorations`. #[serde(skip_serializing_if = "Option::is_none")] @@ -684,6 +726,7 @@ impl<'a> CreateSubscription<'a> { default_source: Default::default(), default_tax_rates: Default::default(), description: Default::default(), + discounts: Default::default(), expand: Default::default(), invoice_settings: Default::default(), items: Default::default(), @@ -717,12 +760,15 @@ pub struct ListSubscriptions<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub collection_method: Option, + /// Only return subscriptions that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, + /// Only return subscriptions whose current_period_end falls within the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub current_period_end: Option>, + /// Only return subscriptions whose current_period_start falls within the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub current_period_start: Option>, @@ -847,7 +893,9 @@ pub struct UpdateSubscription<'a> { #[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. + /// Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). + /// + /// Defaults to `false`. #[serde(skip_serializing_if = "Option::is_none")] pub cancel_at_period_end: Option, @@ -866,6 +914,8 @@ pub struct UpdateSubscription<'a> { /// 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. + /// This field has been deprecated and will be removed in a future API version. + /// Use `discounts` instead. #[serde(skip_serializing_if = "Option::is_none")] pub coupon: Option, @@ -904,6 +954,12 @@ pub struct UpdateSubscription<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, + /// The coupons to redeem into discounts for the subscription. + /// + /// If not specified or empty, inherits the discount from the subscription's customer. + #[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], @@ -925,6 +981,8 @@ pub struct UpdateSubscription<'a> { pub metadata: Option, /// Indicates if a customer is on or off-session while an invoice payment is attempted. + /// + /// Defaults to `false` (on-session). #[serde(skip_serializing_if = "Option::is_none")] pub off_session: Option, @@ -933,6 +991,9 @@ pub struct UpdateSubscription<'a> { pub on_behalf_of: Option, /// If specified, payment collection for this subscription will be paused. + /// + /// Note that the subscription status will be unchanged and will not be updated to `paused`. + /// Learn more about [pausing collection](/billing/subscriptions/pause-payment). #[serde(skip_serializing_if = "Option::is_none")] pub pause_collection: Option, @@ -964,10 +1025,12 @@ pub struct UpdateSubscription<'a> { /// The promotion code to apply to this subscription. /// /// A promotion code applied to a subscription will only affect invoices created for that particular subscription. + /// This field has been deprecated and will be removed in a future API version. + /// Use `discounts` instead. #[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. + /// Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/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")] @@ -1026,6 +1089,7 @@ impl<'a> UpdateSubscription<'a> { default_source: Default::default(), default_tax_rates: Default::default(), description: Default::default(), + discounts: Default::default(), expand: Default::default(), invoice_settings: Default::default(), items: Default::default(), @@ -1049,11 +1113,19 @@ impl<'a> UpdateSubscription<'a> { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct AddInvoiceItems { + /// The coupons to redeem into discounts for the item. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option>, + /// The ID of the price 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, @@ -1115,6 +1187,21 @@ pub struct CreateSubscriptionBillingCycleAnchorConfig { pub second: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSubscriptionDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSubscriptionInvoiceSettings { /// The account tax IDs associated with the subscription. @@ -1138,6 +1225,10 @@ pub struct CreateSubscriptionItems { #[serde(skip_serializing_if = "Option::is_none")] pub billing_thresholds: Option, + /// The coupons to redeem into discounts for the subscription item. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: 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. @@ -1183,9 +1274,9 @@ pub struct CreateSubscriptionPaymentSettings { #[serde(skip_serializing_if = "Option::is_none")] pub payment_method_types: Option>, - /// Either `off`, or `on_subscription`. + /// Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. /// - /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + /// Defaults to `off` if unspecified. #[serde(skip_serializing_if = "Option::is_none")] pub save_default_payment_method: Option, @@ -1255,6 +1346,21 @@ pub struct UpdateSubscriptionCancellationDetails { pub feedback: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSubscriptionDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSubscriptionInvoiceSettings { /// The account tax IDs associated with the subscription. @@ -1288,6 +1394,10 @@ pub struct UpdateSubscriptionItems { #[serde(skip_serializing_if = "Option::is_none")] pub deleted: Option, + /// The coupons to redeem into discounts for the subscription item. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option>, + /// Subscription item to update. #[serde(skip_serializing_if = "Option::is_none")] pub id: Option, @@ -1306,11 +1416,14 @@ pub struct UpdateSubscriptionItems { /// The ID of the price object. /// + /// One of `price` or `price_data` is required. /// 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. + /// + /// One of `price` or `price_data` is required. #[serde(skip_serializing_if = "Option::is_none")] pub price_data: Option, @@ -1351,9 +1464,9 @@ pub struct UpdateSubscriptionPaymentSettings { #[serde(skip_serializing_if = "Option::is_none")] pub payment_method_types: Option>, - /// Either `off`, or `on_subscription`. + /// Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. /// - /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + /// Defaults to `off` if unspecified. #[serde(skip_serializing_if = "Option::is_none")] pub save_default_payment_method: Option, @@ -1393,6 +1506,21 @@ pub struct UpdateSubscriptionTrialSettings { pub end_behavior: UpdateSubscriptionTrialSettingsEndBehavior, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct AddInvoiceItemsDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSubscriptionAutomaticTaxLiability { /// The connected account being referenced when `type` is `account`. @@ -1421,6 +1549,21 @@ pub struct CreateSubscriptionItemsBillingThresholds { pub usage_gte: i64, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSubscriptionItemsDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, +} + #[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. @@ -1444,6 +1587,10 @@ pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub konbini: Option, + /// This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: 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, @@ -1473,7 +1620,7 @@ pub struct InvoiceItemPriceData { #[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. + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount: Option, @@ -1538,6 +1685,21 @@ pub struct UpdateSubscriptionInvoiceSettingsIssuer { pub type_: UpdateSubscriptionInvoiceSettingsIssuerType, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSubscriptionItemsDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, +} + #[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. @@ -1561,6 +1723,10 @@ pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub konbini: Option, + /// This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: 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, @@ -1610,7 +1776,7 @@ pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard { /// 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. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#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, @@ -1633,6 +1799,9 @@ pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsKonbini {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsSepaDebit {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount { /// Additional fields for Financial Connections Session creation. @@ -1701,7 +1870,7 @@ pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard { /// 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. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#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, @@ -1724,6 +1893,9 @@ pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsKonbini {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsSepaDebit {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount { /// Additional fields for Financial Connections Session creation. @@ -1785,6 +1957,10 @@ pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceB #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections { + /// Provide filters for the linked accounts that the customer can select for the payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option, + /// The list of permissions to request. /// /// If this parameter is passed, the `payment_method` permission must be included. @@ -1843,6 +2019,10 @@ pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceB #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections { + /// Provide filters for the linked accounts that the customer can select for the payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option, + /// The list of permissions to request. /// /// If this parameter is passed, the `payment_method` permission must be included. @@ -1864,6 +2044,16 @@ pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceB pub country: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters { + + /// The account subcategories to use to filter for selectable accounts. + /// + /// Valid subcategories are `checking` and `savings`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_subcategories: Option>, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer { @@ -1873,6 +2063,16 @@ pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceB pub country: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters { + + /// The account subcategories to use to filter for selectable accounts. + /// + /// Valid subcategories are `checking` and `savings`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_subcategories: Option>, +} + /// 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")] @@ -2201,6 +2401,7 @@ pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { Diners, Discover, EftposAu, + Girocard, Interac, Jcb, Mastercard, @@ -2223,6 +2424,9 @@ impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::EftposAu => { "eftpos_au" } + CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Girocard => { + "girocard" + } CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Interac => "interac", CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Jcb => "jcb", CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Mastercard => { @@ -2294,6 +2498,41 @@ impl std::default::Default } } +/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`'s `account_subcategories` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories +{ + Checking, + Savings, +} + +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + pub fn as_str(self) -> &'static str { + match self { + CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Checking => "checking", + CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Savings => "savings", + } + } +} + +impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn default() -> Self { + Self::Checking + } +} + /// 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")] @@ -2339,6 +2578,7 @@ impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOpt pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { Balances, + Ownership, Transactions, } @@ -2348,6 +2588,7 @@ impl pub fn as_str(self) -> &'static str { match self { CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", + CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Ownership => "ownership", CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", } } @@ -2419,6 +2660,7 @@ pub enum CreateSubscriptionPaymentSettingsPaymentMethodTypes { AchCreditTransfer, AchDebit, AcssDebit, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -2433,13 +2675,16 @@ pub enum CreateSubscriptionPaymentSettingsPaymentMethodTypes { Ideal, Konbini, Link, + Multibanco, P24, Paynow, Paypal, Promptpay, + RevolutPay, SepaCreditTransfer, SepaDebit, Sofort, + Swish, UsBankAccount, WechatPay, } @@ -2452,6 +2697,7 @@ impl CreateSubscriptionPaymentSettingsPaymentMethodTypes { } CreateSubscriptionPaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", CreateSubscriptionPaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", + CreateSubscriptionPaymentSettingsPaymentMethodTypes::AmazonPay => "amazon_pay", CreateSubscriptionPaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", CreateSubscriptionPaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", CreateSubscriptionPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", @@ -2468,15 +2714,18 @@ impl CreateSubscriptionPaymentSettingsPaymentMethodTypes { CreateSubscriptionPaymentSettingsPaymentMethodTypes::Ideal => "ideal", CreateSubscriptionPaymentSettingsPaymentMethodTypes::Konbini => "konbini", CreateSubscriptionPaymentSettingsPaymentMethodTypes::Link => "link", + CreateSubscriptionPaymentSettingsPaymentMethodTypes::Multibanco => "multibanco", CreateSubscriptionPaymentSettingsPaymentMethodTypes::P24 => "p24", CreateSubscriptionPaymentSettingsPaymentMethodTypes::Paynow => "paynow", CreateSubscriptionPaymentSettingsPaymentMethodTypes::Paypal => "paypal", CreateSubscriptionPaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", + CreateSubscriptionPaymentSettingsPaymentMethodTypes::RevolutPay => "revolut_pay", CreateSubscriptionPaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { "sepa_credit_transfer" } CreateSubscriptionPaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", CreateSubscriptionPaymentSettingsPaymentMethodTypes::Sofort => "sofort", + CreateSubscriptionPaymentSettingsPaymentMethodTypes::Swish => "swish", CreateSubscriptionPaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", CreateSubscriptionPaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", } @@ -2799,6 +3048,7 @@ pub enum SubscriptionPaymentMethodOptionsCardNetwork { Diners, Discover, EftposAu, + Girocard, Interac, Jcb, Mastercard, @@ -2815,6 +3065,7 @@ impl SubscriptionPaymentMethodOptionsCardNetwork { SubscriptionPaymentMethodOptionsCardNetwork::Diners => "diners", SubscriptionPaymentMethodOptionsCardNetwork::Discover => "discover", SubscriptionPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", + SubscriptionPaymentMethodOptionsCardNetwork::Girocard => "girocard", SubscriptionPaymentMethodOptionsCardNetwork::Interac => "interac", SubscriptionPaymentMethodOptionsCardNetwork::Jcb => "jcb", SubscriptionPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", @@ -3053,6 +3304,7 @@ pub enum SubscriptionsResourcePaymentSettingsPaymentMethodTypes { AchCreditTransfer, AchDebit, AcssDebit, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -3067,13 +3319,16 @@ pub enum SubscriptionsResourcePaymentSettingsPaymentMethodTypes { Ideal, Konbini, Link, + Multibanco, P24, Paynow, Paypal, Promptpay, + RevolutPay, SepaCreditTransfer, SepaDebit, Sofort, + Swish, UsBankAccount, WechatPay, } @@ -3086,6 +3341,7 @@ impl SubscriptionsResourcePaymentSettingsPaymentMethodTypes { } SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", + SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AmazonPay => "amazon_pay", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", @@ -3102,15 +3358,18 @@ impl SubscriptionsResourcePaymentSettingsPaymentMethodTypes { SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Ideal => "ideal", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Konbini => "konbini", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Link => "link", + SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Multibanco => "multibanco", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::P24 => "p24", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Paynow => "paynow", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Paypal => "paypal", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", + SubscriptionsResourcePaymentSettingsPaymentMethodTypes::RevolutPay => "revolut_pay", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { "sepa_credit_transfer" } SubscriptionsResourcePaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Sofort => "sofort", + SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Swish => "swish", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::UsBankAccount => { "us_bank_account" } @@ -3500,6 +3759,7 @@ pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { Diners, Discover, EftposAu, + Girocard, Interac, Jcb, Mastercard, @@ -3522,6 +3782,9 @@ impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::EftposAu => { "eftpos_au" } + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Girocard => { + "girocard" + } UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Interac => "interac", UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Jcb => "jcb", UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Mastercard => { @@ -3593,6 +3856,41 @@ impl std::default::Default } } +/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`'s `account_subcategories` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories +{ + Checking, + Savings, +} + +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + pub fn as_str(self) -> &'static str { + match self { + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Checking => "checking", + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::Savings => "savings", + } + } +} + +impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories { + fn default() -> Self { + Self::Checking + } +} + /// 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")] @@ -3638,6 +3936,7 @@ impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOpt pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { Balances, + Ownership, Transactions, } @@ -3647,6 +3946,7 @@ impl pub fn as_str(self) -> &'static str { match self { UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Ownership => "ownership", UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", } } @@ -3718,6 +4018,7 @@ pub enum UpdateSubscriptionPaymentSettingsPaymentMethodTypes { AchCreditTransfer, AchDebit, AcssDebit, + AmazonPay, AuBecsDebit, BacsDebit, Bancontact, @@ -3732,13 +4033,16 @@ pub enum UpdateSubscriptionPaymentSettingsPaymentMethodTypes { Ideal, Konbini, Link, + Multibanco, P24, Paynow, Paypal, Promptpay, + RevolutPay, SepaCreditTransfer, SepaDebit, Sofort, + Swish, UsBankAccount, WechatPay, } @@ -3751,6 +4055,7 @@ impl UpdateSubscriptionPaymentSettingsPaymentMethodTypes { } UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", + UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AmazonPay => "amazon_pay", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", @@ -3767,15 +4072,18 @@ impl UpdateSubscriptionPaymentSettingsPaymentMethodTypes { UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Ideal => "ideal", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Konbini => "konbini", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Link => "link", + UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Multibanco => "multibanco", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::P24 => "p24", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Paynow => "paynow", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Paypal => "paypal", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", + UpdateSubscriptionPaymentSettingsPaymentMethodTypes::RevolutPay => "revolut_pay", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { "sepa_credit_transfer" } UpdateSubscriptionPaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Sofort => "sofort", + UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Swish => "swish", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", } diff --git a/src/resources/generated/subscription_item.rs b/src/resources/generated/subscription_item.rs index 1f7a75dcc..81377d1e3 100644 --- a/src/resources/generated/subscription_item.rs +++ b/src/resources/generated/subscription_item.rs @@ -6,8 +6,10 @@ 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}; +use crate::params::{Deleted, Expand, Expandable, List, Metadata, Object, Paginable, Timestamp}; +use crate::resources::{ + Currency, Discount, Plan, Price, SubscriptionItemBillingThresholds, TaxRate, +}; /// The resource representing a Stripe "SubscriptionItem". /// @@ -31,6 +33,13 @@ pub struct SubscriptionItem { #[serde(default)] pub deleted: bool, + /// The discounts applied to the subscription item. + /// + /// Subscription item discounts are applied before subscription discounts. + /// Use `expand[]=discounts` to expand each discount. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: 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. @@ -127,6 +136,10 @@ pub struct CreateSubscriptionItem<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub billing_thresholds: Option, + /// The coupons to redeem into discounts for the subscription item. + #[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], @@ -166,7 +179,7 @@ pub struct CreateSubscriptionItem<'a> { #[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. + /// Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/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")] @@ -197,6 +210,7 @@ impl<'a> CreateSubscriptionItem<'a> { pub fn new(subscription: SubscriptionId) -> Self { CreateSubscriptionItem { billing_thresholds: Default::default(), + discounts: Default::default(), expand: Default::default(), metadata: Default::default(), payment_behavior: Default::default(), @@ -269,6 +283,10 @@ pub struct UpdateSubscriptionItem<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub billing_thresholds: Option, + /// The coupons to redeem into discounts for the subscription item. + #[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], @@ -282,6 +300,8 @@ pub struct UpdateSubscriptionItem<'a> { pub metadata: Option, /// Indicates if a customer is on or off-session while an invoice payment is attempted. + /// + /// Defaults to `false` (on-session). #[serde(skip_serializing_if = "Option::is_none")] pub off_session: Option, @@ -306,15 +326,18 @@ pub struct UpdateSubscriptionItem<'a> { /// The ID of the price object. /// + /// One of `price` or `price_data` is required. /// 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. + /// + /// One of `price` or `price_data` is required. #[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. + /// Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/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")] @@ -342,6 +365,7 @@ impl<'a> UpdateSubscriptionItem<'a> { pub fn new() -> Self { UpdateSubscriptionItem { billing_thresholds: Default::default(), + discounts: Default::default(), expand: Default::default(), metadata: Default::default(), off_session: Default::default(), @@ -357,6 +381,21 @@ impl<'a> UpdateSubscriptionItem<'a> { } } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSubscriptionItemDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: 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. @@ -389,6 +428,21 @@ pub struct SubscriptionItemPriceData { pub unit_amount_decimal: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSubscriptionItemDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SubscriptionItemPriceDataRecurring { /// Specifies billing frequency. diff --git a/src/resources/generated/subscription_schedule.rs b/src/resources/generated/subscription_schedule.rs index d87c79a48..412daf299 100644 --- a/src/resources/generated/subscription_schedule.rs +++ b/src/resources/generated/subscription_schedule.rs @@ -9,9 +9,9 @@ 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, + Discount, PaymentMethod, Plan, Price, PromotionCode, Scheduled, Subscription, + SubscriptionBillingThresholds, SubscriptionItemBillingThresholds, SubscriptionTransferData, + TaxId, TaxRate, TestHelpersTestClock, }; /// The resource representing a Stripe "SubscriptionSchedule". @@ -200,6 +200,11 @@ pub struct SubscriptionSchedulePhaseConfiguration { /// 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 stackable discounts that will be applied to the subscription on this phase. + /// + /// Subscription item discounts are applied before subscription discounts. + pub discounts: Vec, + /// The end of this phase of the subscription schedule. pub end_date: Timestamp, @@ -235,12 +240,23 @@ pub struct SubscriptionSchedulePhaseConfiguration { pub trial_end: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct DiscountsResourceStackableDiscount { + /// ID of the coupon to create a new discount for. + pub coupon: Option>, + + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + pub discount: Option>, + + /// ID of the promotion code to create a new discount for. + pub promotion_code: 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. @@ -268,6 +284,9 @@ pub struct SchedulesPhaseAutomaticTax { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SubscriptionScheduleAddInvoiceItem { + /// The stackable discounts that will be applied to the item. + pub discounts: Vec, + /// ID of the price used to generate the invoice item. pub price: Expandable, @@ -286,6 +305,12 @@ 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, + /// The discounts applied to the subscription item. + /// + /// Subscription item discounts are applied before subscription discounts. + /// Use `expand[]=discounts` to expand each discount. + pub discounts: Vec, + /// 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. @@ -606,7 +631,10 @@ pub struct CreateSubscriptionSchedulePhases { #[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. + /// The ID of the coupon to apply to this phase of the subscription schedule. + /// + /// This field has been deprecated and will be removed in a future API version. + /// Use `discounts` instead. #[serde(skip_serializing_if = "Option::is_none")] pub coupon: Option, @@ -635,6 +663,13 @@ pub struct CreateSubscriptionSchedulePhases { #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, + /// The coupons to redeem into discounts for the schedule phase. + /// + /// If not specified, inherits the discount from the subscription's customer. + /// Pass an empty string to avoid inheriting any discounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option>, + /// The date at which this phase of the subscription schedule ends. /// /// If set, `iterations` must not be set. @@ -792,7 +827,10 @@ pub struct UpdateSubscriptionSchedulePhases { #[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. + /// The ID of the coupon to apply to this phase of the subscription schedule. + /// + /// This field has been deprecated and will be removed in a future API version. + /// Use `discounts` instead. #[serde(skip_serializing_if = "Option::is_none")] pub coupon: Option, @@ -821,6 +859,13 @@ pub struct UpdateSubscriptionSchedulePhases { #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, + /// The coupons to redeem into discounts for the schedule phase. + /// + /// If not specified, inherits the discount from the subscription's customer. + /// Pass an empty string to avoid inheriting any discounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option>, + /// The date at which this phase of the subscription schedule ends. /// /// If set, `iterations` must not be set. @@ -884,11 +929,19 @@ pub struct UpdateSubscriptionSchedulePhases { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct AddInvoiceItems { + /// The coupons to redeem into discounts for the item. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option>, + /// The ID of the price 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, @@ -918,6 +971,21 @@ pub struct CreateSubscriptionSchedulePhasesAutomaticTax { pub liability: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSubscriptionSchedulePhasesDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: 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. @@ -926,6 +994,10 @@ pub struct CreateSubscriptionSchedulePhasesItems { #[serde(skip_serializing_if = "Option::is_none")] pub billing_thresholds: Option, + /// The coupons to redeem into discounts for the subscription item. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: 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. @@ -1048,6 +1120,21 @@ pub struct UpdateSubscriptionSchedulePhasesAutomaticTax { pub liability: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSubscriptionSchedulePhasesDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: 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. @@ -1056,6 +1143,10 @@ pub struct UpdateSubscriptionSchedulePhasesItems { #[serde(skip_serializing_if = "Option::is_none")] pub billing_thresholds: Option, + /// The coupons to redeem into discounts for the subscription item. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: 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. @@ -1105,6 +1196,21 @@ pub struct UpdateSubscriptionSchedulePhasesTransferData { pub destination: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct AddInvoiceItemsDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSubscriptionSchedulePhasesAutomaticTaxLiability { /// The connected account being referenced when `type` is `account`. @@ -1122,6 +1228,21 @@ pub struct CreateSubscriptionSchedulePhasesItemsBillingThresholds { pub usage_gte: i64, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSubscriptionSchedulePhasesItemsDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, +} + #[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. @@ -1172,7 +1293,7 @@ pub struct InvoiceItemPriceData { #[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. + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount: Option, @@ -1222,6 +1343,21 @@ pub struct UpdateSubscriptionSchedulePhasesItemsBillingThresholds { pub usage_gte: i64, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSubscriptionSchedulePhasesItemsDiscounts { + /// 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, + + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, +} + #[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. diff --git a/src/resources/generated/tax_calculation.rs b/src/resources/generated/tax_calculation.rs index 6f98acdc0..4a0f51dcd 100644 --- a/src/resources/generated/tax_calculation.rs +++ b/src/resources/generated/tax_calculation.rs @@ -6,7 +6,10 @@ use serde::{Deserialize, Serialize}; use crate::ids::TaxCalculationId; use crate::params::{List, Object, Timestamp}; -use crate::resources::{Currency, TaxCalculationLineItem, TaxProductResourceCustomerDetails}; +use crate::resources::{ + Currency, TaxCalculationLineItem, TaxProductResourceCustomerDetails, + TaxProductResourceShipFromDetails, +}; /// The resource representing a Stripe "TaxProductResourceTaxCalculation". /// @@ -16,7 +19,7 @@ pub struct TaxCalculation { /// Unique identifier for the calculation. pub id: TaxCalculationId, - /// Total after taxes. + /// Total amount after taxes in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). pub amount_total: i64, /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. @@ -33,11 +36,15 @@ pub struct TaxCalculation { pub expires_at: Option, /// The list of items the customer is purchasing. + #[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 details of the ship from location, such as the address. + pub ship_from_details: Option, + /// The shipping cost details for the calculation. pub shipping_cost: Option, diff --git a/src/resources/generated/tax_calculation_line_item.rs b/src/resources/generated/tax_calculation_line_item.rs index 2ced34f23..b586e020c 100644 --- a/src/resources/generated/tax_calculation_line_item.rs +++ b/src/resources/generated/tax_calculation_line_item.rs @@ -42,6 +42,7 @@ pub struct TaxCalculationLineItem { pub tax_behavior: TaxCalculationLineItemTaxBehavior, /// Detailed account of taxes relevant to this line item. + #[serde(skip_serializing_if = "Option::is_none")] pub tax_breakdown: Option>, /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. diff --git a/src/resources/generated/tax_id.rs b/src/resources/generated/tax_id.rs index a637ea016..689864650 100644 --- a/src/resources/generated/tax_id.rs +++ b/src/resources/generated/tax_id.rs @@ -43,7 +43,7 @@ pub struct TaxId { #[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`. + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `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")] @@ -136,7 +136,7 @@ pub struct CreateTaxId<'a> { #[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`. + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `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, @@ -366,6 +366,7 @@ pub enum TaxIdType { AuAbn, AuArn, BgUic, + BhVat, BoTin, BrCnpj, BrCpf, @@ -375,11 +376,13 @@ pub enum TaxIdType { CaPstMb, CaPstSk, CaQst, + ChUid, ChVat, ClTin, CnTin, CoNit, CrTin, + DeStn, DoRcn, EcRuc, EgTin, @@ -389,6 +392,7 @@ pub enum TaxIdType { GbVat, GeVat, HkBr, + HrOib, HuTin, IdNpwp, IlVat, @@ -399,13 +403,17 @@ pub enum TaxIdType { JpTrn, KePin, KrBrn, + KzBin, LiUid, MxRfc, MyFrp, MyItn, MySst, + NgTin, NoVat, + NoVoec, NzGst, + OmVat, PeRuc, PhTin, RoTin, @@ -438,6 +446,7 @@ impl TaxIdType { TaxIdType::AuAbn => "au_abn", TaxIdType::AuArn => "au_arn", TaxIdType::BgUic => "bg_uic", + TaxIdType::BhVat => "bh_vat", TaxIdType::BoTin => "bo_tin", TaxIdType::BrCnpj => "br_cnpj", TaxIdType::BrCpf => "br_cpf", @@ -447,11 +456,13 @@ impl TaxIdType { TaxIdType::CaPstMb => "ca_pst_mb", TaxIdType::CaPstSk => "ca_pst_sk", TaxIdType::CaQst => "ca_qst", + TaxIdType::ChUid => "ch_uid", TaxIdType::ChVat => "ch_vat", TaxIdType::ClTin => "cl_tin", TaxIdType::CnTin => "cn_tin", TaxIdType::CoNit => "co_nit", TaxIdType::CrTin => "cr_tin", + TaxIdType::DeStn => "de_stn", TaxIdType::DoRcn => "do_rcn", TaxIdType::EcRuc => "ec_ruc", TaxIdType::EgTin => "eg_tin", @@ -461,6 +472,7 @@ impl TaxIdType { TaxIdType::GbVat => "gb_vat", TaxIdType::GeVat => "ge_vat", TaxIdType::HkBr => "hk_br", + TaxIdType::HrOib => "hr_oib", TaxIdType::HuTin => "hu_tin", TaxIdType::IdNpwp => "id_npwp", TaxIdType::IlVat => "il_vat", @@ -471,13 +483,17 @@ impl TaxIdType { TaxIdType::JpTrn => "jp_trn", TaxIdType::KePin => "ke_pin", TaxIdType::KrBrn => "kr_brn", + TaxIdType::KzBin => "kz_bin", TaxIdType::LiUid => "li_uid", TaxIdType::MxRfc => "mx_rfc", TaxIdType::MyFrp => "my_frp", TaxIdType::MyItn => "my_itn", TaxIdType::MySst => "my_sst", + TaxIdType::NgTin => "ng_tin", TaxIdType::NoVat => "no_vat", + TaxIdType::NoVoec => "no_voec", TaxIdType::NzGst => "nz_gst", + TaxIdType::OmVat => "om_vat", TaxIdType::PeRuc => "pe_ruc", TaxIdType::PhTin => "ph_tin", TaxIdType::RoTin => "ro_tin", @@ -530,6 +546,7 @@ pub enum TaxIdTypeFilter { AuAbn, AuArn, BgUic, + BhVat, BoTin, BrCnpj, BrCpf, @@ -539,11 +556,13 @@ pub enum TaxIdTypeFilter { CaPstMb, CaPstSk, CaQst, + ChUid, ChVat, ClTin, CnTin, CoNit, CrTin, + DeStn, DoRcn, EcRuc, EgTin, @@ -553,6 +572,7 @@ pub enum TaxIdTypeFilter { GbVat, GeVat, HkBr, + HrOib, HuTin, IdNpwp, IlVat, @@ -563,13 +583,17 @@ pub enum TaxIdTypeFilter { JpTrn, KePin, KrBrn, + KzBin, LiUid, MxRfc, MyFrp, MyItn, MySst, + NgTin, NoVat, + NoVoec, NzGst, + OmVat, PeRuc, PhTin, RoTin, @@ -601,6 +625,7 @@ impl TaxIdTypeFilter { TaxIdTypeFilter::AuAbn => "au_abn", TaxIdTypeFilter::AuArn => "au_arn", TaxIdTypeFilter::BgUic => "bg_uic", + TaxIdTypeFilter::BhVat => "bh_vat", TaxIdTypeFilter::BoTin => "bo_tin", TaxIdTypeFilter::BrCnpj => "br_cnpj", TaxIdTypeFilter::BrCpf => "br_cpf", @@ -610,11 +635,13 @@ impl TaxIdTypeFilter { TaxIdTypeFilter::CaPstMb => "ca_pst_mb", TaxIdTypeFilter::CaPstSk => "ca_pst_sk", TaxIdTypeFilter::CaQst => "ca_qst", + TaxIdTypeFilter::ChUid => "ch_uid", TaxIdTypeFilter::ChVat => "ch_vat", TaxIdTypeFilter::ClTin => "cl_tin", TaxIdTypeFilter::CnTin => "cn_tin", TaxIdTypeFilter::CoNit => "co_nit", TaxIdTypeFilter::CrTin => "cr_tin", + TaxIdTypeFilter::DeStn => "de_stn", TaxIdTypeFilter::DoRcn => "do_rcn", TaxIdTypeFilter::EcRuc => "ec_ruc", TaxIdTypeFilter::EgTin => "eg_tin", @@ -624,6 +651,7 @@ impl TaxIdTypeFilter { TaxIdTypeFilter::GbVat => "gb_vat", TaxIdTypeFilter::GeVat => "ge_vat", TaxIdTypeFilter::HkBr => "hk_br", + TaxIdTypeFilter::HrOib => "hr_oib", TaxIdTypeFilter::HuTin => "hu_tin", TaxIdTypeFilter::IdNpwp => "id_npwp", TaxIdTypeFilter::IlVat => "il_vat", @@ -634,13 +662,17 @@ impl TaxIdTypeFilter { TaxIdTypeFilter::JpTrn => "jp_trn", TaxIdTypeFilter::KePin => "ke_pin", TaxIdTypeFilter::KrBrn => "kr_brn", + TaxIdTypeFilter::KzBin => "kz_bin", TaxIdTypeFilter::LiUid => "li_uid", TaxIdTypeFilter::MxRfc => "mx_rfc", TaxIdTypeFilter::MyFrp => "my_frp", TaxIdTypeFilter::MyItn => "my_itn", TaxIdTypeFilter::MySst => "my_sst", + TaxIdTypeFilter::NgTin => "ng_tin", TaxIdTypeFilter::NoVat => "no_vat", + TaxIdTypeFilter::NoVoec => "no_voec", TaxIdTypeFilter::NzGst => "nz_gst", + TaxIdTypeFilter::OmVat => "om_vat", TaxIdTypeFilter::PeRuc => "pe_ruc", TaxIdTypeFilter::PhTin => "ph_tin", TaxIdTypeFilter::RoTin => "ro_tin", diff --git a/src/resources/generated/tax_product_resource_customer_details.rs b/src/resources/generated/tax_product_resource_customer_details.rs index e44865f70..8305b3fbc 100644 --- a/src/resources/generated/tax_product_resource_customer_details.rs +++ b/src/resources/generated/tax_product_resource_customer_details.rs @@ -4,6 +4,8 @@ use serde::{Deserialize, Serialize}; +use crate::resources::TaxProductResourcePostalAddress; + /// The resource representing a Stripe "TaxProductResourceCustomerDetails". #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct TaxProductResourceCustomerDetails { @@ -25,7 +27,7 @@ pub struct TaxProductResourceCustomerDetails { #[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`. + /// 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`, `hr_oib`, `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`, `no_voec`, `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`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown`. #[serde(rename = "type")] pub type_: TaxProductResourceCustomerDetailsResourceTaxIdType, @@ -33,29 +35,6 @@ pub struct TaxProductResourceCustomerDetailsResourceTaxId { 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")] @@ -100,6 +79,7 @@ pub enum TaxProductResourceCustomerDetailsResourceTaxIdType { AuAbn, AuArn, BgUic, + BhVat, BoTin, BrCnpj, BrCpf, @@ -109,11 +89,13 @@ pub enum TaxProductResourceCustomerDetailsResourceTaxIdType { CaPstMb, CaPstSk, CaQst, + ChUid, ChVat, ClTin, CnTin, CoNit, CrTin, + DeStn, DoRcn, EcRuc, EgTin, @@ -123,6 +105,7 @@ pub enum TaxProductResourceCustomerDetailsResourceTaxIdType { GbVat, GeVat, HkBr, + HrOib, HuTin, IdNpwp, IlVat, @@ -133,13 +116,17 @@ pub enum TaxProductResourceCustomerDetailsResourceTaxIdType { JpTrn, KePin, KrBrn, + KzBin, LiUid, MxRfc, MyFrp, MyItn, MySst, + NgTin, NoVat, + NoVoec, NzGst, + OmVat, PeRuc, PhTin, RoTin, @@ -172,6 +159,7 @@ impl TaxProductResourceCustomerDetailsResourceTaxIdType { TaxProductResourceCustomerDetailsResourceTaxIdType::AuAbn => "au_abn", TaxProductResourceCustomerDetailsResourceTaxIdType::AuArn => "au_arn", TaxProductResourceCustomerDetailsResourceTaxIdType::BgUic => "bg_uic", + TaxProductResourceCustomerDetailsResourceTaxIdType::BhVat => "bh_vat", TaxProductResourceCustomerDetailsResourceTaxIdType::BoTin => "bo_tin", TaxProductResourceCustomerDetailsResourceTaxIdType::BrCnpj => "br_cnpj", TaxProductResourceCustomerDetailsResourceTaxIdType::BrCpf => "br_cpf", @@ -181,11 +169,13 @@ impl TaxProductResourceCustomerDetailsResourceTaxIdType { TaxProductResourceCustomerDetailsResourceTaxIdType::CaPstMb => "ca_pst_mb", TaxProductResourceCustomerDetailsResourceTaxIdType::CaPstSk => "ca_pst_sk", TaxProductResourceCustomerDetailsResourceTaxIdType::CaQst => "ca_qst", + TaxProductResourceCustomerDetailsResourceTaxIdType::ChUid => "ch_uid", TaxProductResourceCustomerDetailsResourceTaxIdType::ChVat => "ch_vat", TaxProductResourceCustomerDetailsResourceTaxIdType::ClTin => "cl_tin", TaxProductResourceCustomerDetailsResourceTaxIdType::CnTin => "cn_tin", TaxProductResourceCustomerDetailsResourceTaxIdType::CoNit => "co_nit", TaxProductResourceCustomerDetailsResourceTaxIdType::CrTin => "cr_tin", + TaxProductResourceCustomerDetailsResourceTaxIdType::DeStn => "de_stn", TaxProductResourceCustomerDetailsResourceTaxIdType::DoRcn => "do_rcn", TaxProductResourceCustomerDetailsResourceTaxIdType::EcRuc => "ec_ruc", TaxProductResourceCustomerDetailsResourceTaxIdType::EgTin => "eg_tin", @@ -195,6 +185,7 @@ impl TaxProductResourceCustomerDetailsResourceTaxIdType { TaxProductResourceCustomerDetailsResourceTaxIdType::GbVat => "gb_vat", TaxProductResourceCustomerDetailsResourceTaxIdType::GeVat => "ge_vat", TaxProductResourceCustomerDetailsResourceTaxIdType::HkBr => "hk_br", + TaxProductResourceCustomerDetailsResourceTaxIdType::HrOib => "hr_oib", TaxProductResourceCustomerDetailsResourceTaxIdType::HuTin => "hu_tin", TaxProductResourceCustomerDetailsResourceTaxIdType::IdNpwp => "id_npwp", TaxProductResourceCustomerDetailsResourceTaxIdType::IlVat => "il_vat", @@ -205,13 +196,17 @@ impl TaxProductResourceCustomerDetailsResourceTaxIdType { TaxProductResourceCustomerDetailsResourceTaxIdType::JpTrn => "jp_trn", TaxProductResourceCustomerDetailsResourceTaxIdType::KePin => "ke_pin", TaxProductResourceCustomerDetailsResourceTaxIdType::KrBrn => "kr_brn", + TaxProductResourceCustomerDetailsResourceTaxIdType::KzBin => "kz_bin", TaxProductResourceCustomerDetailsResourceTaxIdType::LiUid => "li_uid", TaxProductResourceCustomerDetailsResourceTaxIdType::MxRfc => "mx_rfc", TaxProductResourceCustomerDetailsResourceTaxIdType::MyFrp => "my_frp", TaxProductResourceCustomerDetailsResourceTaxIdType::MyItn => "my_itn", TaxProductResourceCustomerDetailsResourceTaxIdType::MySst => "my_sst", + TaxProductResourceCustomerDetailsResourceTaxIdType::NgTin => "ng_tin", TaxProductResourceCustomerDetailsResourceTaxIdType::NoVat => "no_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::NoVoec => "no_voec", TaxProductResourceCustomerDetailsResourceTaxIdType::NzGst => "nz_gst", + TaxProductResourceCustomerDetailsResourceTaxIdType::OmVat => "om_vat", TaxProductResourceCustomerDetailsResourceTaxIdType::PeRuc => "pe_ruc", TaxProductResourceCustomerDetailsResourceTaxIdType::PhTin => "ph_tin", TaxProductResourceCustomerDetailsResourceTaxIdType::RoTin => "ro_tin", diff --git a/src/resources/generated/tax_product_resource_ship_from_details.rs b/src/resources/generated/tax_product_resource_ship_from_details.rs new file mode 100644 index 000000000..d1457e276 --- /dev/null +++ b/src/resources/generated/tax_product_resource_ship_from_details.rs @@ -0,0 +1,13 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::resources::{TaxProductResourcePostalAddress}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "TaxProductResourceShipFromDetails". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceShipFromDetails { + + pub address: TaxProductResourcePostalAddress, +} diff --git a/src/resources/generated/tax_rate.rs b/src/resources/generated/tax_rate.rs index d73dded86..533425743 100644 --- a/src/resources/generated/tax_rate.rs +++ b/src/resources/generated/tax_rate.rs @@ -375,7 +375,6 @@ pub enum TaxRateTaxType { Qst, Rst, SalesTax, - ServiceTax, Vat, } @@ -393,7 +392,6 @@ impl TaxRateTaxType { TaxRateTaxType::Qst => "qst", TaxRateTaxType::Rst => "rst", TaxRateTaxType::SalesTax => "sales_tax", - TaxRateTaxType::ServiceTax => "service_tax", TaxRateTaxType::Vat => "vat", } } diff --git a/src/resources/generated/tax_registration.rs b/src/resources/generated/tax_registration.rs index 9200736f3..f7827a239 100644 --- a/src/resources/generated/tax_registration.rs +++ b/src/resources/generated/tax_registration.rs @@ -72,6 +72,9 @@ pub struct TaxProductRegistrationsResourceCountryOptions { #[serde(skip_serializing_if = "Option::is_none")] pub bg: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bh: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub ca: Option, @@ -99,6 +102,9 @@ pub struct TaxProductRegistrationsResourceCountryOptions { #[serde(skip_serializing_if = "Option::is_none")] pub ee: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eg: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub es: Option, @@ -111,6 +117,9 @@ pub struct TaxProductRegistrationsResourceCountryOptions { #[serde(skip_serializing_if = "Option::is_none")] pub gb: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ge: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub gr: Option, @@ -135,9 +144,15 @@ pub struct TaxProductRegistrationsResourceCountryOptions { #[serde(skip_serializing_if = "Option::is_none")] pub jp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ke: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub kr: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub kz: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub lt: Option, @@ -156,6 +171,9 @@ pub struct TaxProductRegistrationsResourceCountryOptions { #[serde(skip_serializing_if = "Option::is_none")] pub my: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ng: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub nl: Option, @@ -165,6 +183,9 @@ pub struct TaxProductRegistrationsResourceCountryOptions { #[serde(skip_serializing_if = "Option::is_none")] pub nz: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub om: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub pl: Option, @@ -269,6 +290,9 @@ pub struct TaxProductRegistrationsResourceCountryOptionsUnitedStates { /// Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). pub state: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub state_sales_tax: Option, + /// Type of registration in the US. #[serde(rename = "type")] pub type_: TaxProductRegistrationsResourceCountryOptionsUnitedStatesType, @@ -288,6 +312,26 @@ pub struct TaxProductRegistrationsResourceCountryOptionsUsLocalLeaseTax { pub jurisdiction: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsUsStateSalesTax { + + /// Elections for the state sales tax registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub elections: Option>, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsUsStateSalesTaxElection { + + /// A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub jurisdiction: Option, + + /// The type of the election for the state sales tax registration. + #[serde(rename = "type")] + pub type_: TaxProductRegistrationsResourceCountryOptionsUsStateSalesTaxElectionType, +} + /// 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")] @@ -498,6 +542,42 @@ impl std::default::Default for TaxProductRegistrationsResourceCountryOptionsUnit } } +/// An enum representing the possible values of an `TaxProductRegistrationsResourceCountryOptionsUsStateSalesTaxElection`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxProductRegistrationsResourceCountryOptionsUsStateSalesTaxElectionType { + LocalUseTax, + SimplifiedSellersUseTax, + SingleLocalUseTax, +} + +impl TaxProductRegistrationsResourceCountryOptionsUsStateSalesTaxElectionType { + pub fn as_str(self) -> &'static str { + match self { + TaxProductRegistrationsResourceCountryOptionsUsStateSalesTaxElectionType::LocalUseTax => "local_use_tax", + TaxProductRegistrationsResourceCountryOptionsUsStateSalesTaxElectionType::SimplifiedSellersUseTax => "simplified_sellers_use_tax", + TaxProductRegistrationsResourceCountryOptionsUsStateSalesTaxElectionType::SingleLocalUseTax => "single_local_use_tax", + } + } +} + +impl AsRef for TaxProductRegistrationsResourceCountryOptionsUsStateSalesTaxElectionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsUsStateSalesTaxElectionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxProductRegistrationsResourceCountryOptionsUsStateSalesTaxElectionType { + fn default() -> Self { + Self::LocalUseTax + } +} + /// 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")] diff --git a/src/resources/generated/tax_settings.rs b/src/resources/generated/tax_settings.rs index be6357b5d..f3d807e0e 100644 --- a/src/resources/generated/tax_settings.rs +++ b/src/resources/generated/tax_settings.rs @@ -20,9 +20,7 @@ pub struct TaxSettings { /// 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. + /// The status of the Tax `Settings`. pub status: TaxSettingsStatus, pub status_details: TaxProductResourceTaxSettingsStatusDetails, diff --git a/src/resources/generated/tax_transaction.rs b/src/resources/generated/tax_transaction.rs index 790efe1d7..0786cf2f9 100644 --- a/src/resources/generated/tax_transaction.rs +++ b/src/resources/generated/tax_transaction.rs @@ -4,7 +4,7 @@ use crate::ids::{TaxTransactionId}; use crate::params::{List, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TaxProductResourceCustomerDetails, TaxTransactionLineItem}; +use crate::resources::{Currency, TaxProductResourceCustomerDetails, TaxProductResourceShipFromDetails, TaxTransactionLineItem}; use serde::{Deserialize, Serialize}; /// The resource representing a Stripe "TaxProductResourceTaxTransaction". @@ -31,6 +31,7 @@ pub struct TaxTransaction { pub customer_details: TaxProductResourceCustomerDetails, /// The tax collected or refunded, by line item. + #[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. @@ -41,12 +42,18 @@ pub struct TaxTransaction { /// This can be useful for storing additional information about the object in a structured format. pub metadata: Option, + /// The Unix timestamp representing when the tax liability is assumed or reduced. + pub posted_at: Timestamp, + /// A custom unique identifier, such as 'myOrder_123'. pub reference: String, /// If `type=reversal`, contains information about what was reversed. pub reversal: Option, + /// The details of the ship from location, such as the address. + pub ship_from_details: Option, + /// The shipping cost details for the transaction. pub shipping_cost: Option, diff --git a/src/resources/generated/terminal_configuration.rs b/src/resources/generated/terminal_configuration.rs index e03396e73..20b501a8d 100644 --- a/src/resources/generated/terminal_configuration.rs +++ b/src/resources/generated/terminal_configuration.rs @@ -32,9 +32,19 @@ pub struct TerminalConfiguration { #[serde(skip_serializing_if = "Option::is_none")] pub livemode: Option, + /// String indicating the name of the Configuration object, set by the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub offline: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub reboot_window: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stripe_s700: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub tipping: Option, @@ -86,6 +96,17 @@ pub struct TerminalConfigurationConfigurationResourceOfflineConfig { pub enabled: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TerminalConfigurationConfigurationResourceRebootWindow { + /// Integer between 0 to 23 that represents the end hour of the reboot time window. + /// + /// The value must be different than the start_hour. + pub end_hour: i64, + + /// Integer between 0 to 23 that represents the start hour of the reboot time window. + pub start_hour: i64, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct TerminalConfigurationConfigurationResourceTipping { #[serde(skip_serializing_if = "Option::is_none")] @@ -157,10 +178,22 @@ pub struct CreateTerminalConfiguration<'a> { #[serde(skip_serializing_if = "Expand::is_empty")] pub expand: &'a [&'a str], + /// Name of the configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Configurations for collecting transactions offline. #[serde(skip_serializing_if = "Option::is_none")] pub offline: Option, + /// Reboot time settings for readers that support customized reboot time configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub reboot_window: Option, + + /// An object containing device type specific settings for Stripe S700 readers. + #[serde(skip_serializing_if = "Option::is_none")] + pub stripe_s700: Option, + /// Tipping configurations for readers supporting on-reader tips. #[serde(skip_serializing_if = "Option::is_none")] pub tipping: Option, @@ -175,7 +208,10 @@ impl<'a> CreateTerminalConfiguration<'a> { CreateTerminalConfiguration { bbpos_wisepos_e: Default::default(), expand: Default::default(), + name: Default::default(), offline: Default::default(), + reboot_window: Default::default(), + stripe_s700: Default::default(), tipping: Default::default(), verifone_p400: Default::default(), } @@ -246,6 +282,24 @@ pub struct CreateTerminalConfigurationOffline { pub enabled: bool, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateTerminalConfigurationRebootWindow { + /// Integer between 0 to 23 that represents the end hour of the reboot time window. + /// + /// The value must be different than the start_hour. + pub end_hour: i64, + + /// Integer between 0 to 23 that represents the start hour of the reboot time window. + pub start_hour: i64, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateTerminalConfigurationStripeS700 { + /// 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 CreateTerminalConfigurationTipping { /// Tipping configuration for AUD. diff --git a/src/resources/generated/terminal_connection_token.rs b/src/resources/generated/terminal_connection_token.rs index 487f3dc58..098557db3 100644 --- a/src/resources/generated/terminal_connection_token.rs +++ b/src/resources/generated/terminal_connection_token.rs @@ -15,7 +15,7 @@ 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). + /// For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). #[serde(skip_serializing_if = "Option::is_none")] pub location: Option, @@ -55,7 +55,7 @@ pub struct CreateTerminalConnectionToken<'a> { /// /// 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). + /// For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). #[serde(skip_serializing_if = "Option::is_none")] pub location: Option<&'a str>, } diff --git a/src/resources/generated/terminal_location.rs b/src/resources/generated/terminal_location.rs index d3cf75122..d5919a135 100644 --- a/src/resources/generated/terminal_location.rs +++ b/src/resources/generated/terminal_location.rs @@ -84,6 +84,8 @@ pub struct CreateTerminalLocation<'a> { pub configuration_overrides: Option<&'a str>, /// A name for the location. + /// + /// Maximum length is 1000 characters. pub display_name: &'a str, /// Specifies which fields in the response should be expanded. diff --git a/src/resources/generated/terminal_reader.rs b/src/resources/generated/terminal_reader.rs index 5e4c8b291..860ff652c 100644 --- a/src/resources/generated/terminal_reader.rs +++ b/src/resources/generated/terminal_reader.rs @@ -29,7 +29,7 @@ pub struct TerminalReader { #[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`. + /// Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `stripe_s700`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, `simulated_wisepos_e`, or `mobile_phone_reader`. #[serde(skip_serializing_if = "Option::is_none")] pub device_type: Option, @@ -60,6 +60,8 @@ pub struct TerminalReader { pub serial_number: Option, /// The networking status of the reader. + /// + /// We do not recommend using this field in flows that may block taking payments. #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, } @@ -129,6 +131,10 @@ pub struct TerminalReaderReaderResourceProcessPaymentIntentAction { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct TerminalReaderReaderResourceProcessConfig { + /// Enable customer initiated cancellation when processing this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_customer_cancellation: Option, + /// Override showing a tipping selection screen on this transaction. #[serde(skip_serializing_if = "Option::is_none")] pub skip_tipping: Option, @@ -153,7 +159,11 @@ pub struct TerminalReaderReaderResourceProcessSetupIntentAction { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceProcessSetupConfig {} +pub struct TerminalReaderReaderResourceProcessSetupConfig { + /// Enable customer initiated cancellation when processing this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_customer_cancellation: Option, +} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct TerminalReaderReaderResourceRefundPaymentAction { @@ -191,6 +201,9 @@ pub struct TerminalReaderReaderResourceRefundPaymentAction { #[serde(skip_serializing_if = "Option::is_none")] pub refund_application_fee: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_payment_config: 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). @@ -199,6 +212,13 @@ pub struct TerminalReaderReaderResourceRefundPaymentAction { pub reverse_transfer: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TerminalReaderReaderResourceRefundPaymentConfig { + /// Enable customer initiated cancellation when refunding this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_customer_cancellation: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct TerminalReaderReaderResourceSetReaderDisplayAction { /// Cart object to be displayed by the reader. @@ -365,8 +385,10 @@ pub enum TerminalReaderDeviceType { BbposChipper2x, BbposWisepad3, BbposWiseposE, + MobilePhoneReader, SimulatedWiseposE, StripeM2, + StripeS700, #[serde(rename = "verifone_P400")] VerifoneP400, } @@ -377,8 +399,10 @@ impl TerminalReaderDeviceType { TerminalReaderDeviceType::BbposChipper2x => "bbpos_chipper2x", TerminalReaderDeviceType::BbposWisepad3 => "bbpos_wisepad3", TerminalReaderDeviceType::BbposWiseposE => "bbpos_wisepos_e", + TerminalReaderDeviceType::MobilePhoneReader => "mobile_phone_reader", TerminalReaderDeviceType::SimulatedWiseposE => "simulated_wisepos_e", TerminalReaderDeviceType::StripeM2 => "stripe_m2", + TerminalReaderDeviceType::StripeS700 => "stripe_s700", TerminalReaderDeviceType::VerifoneP400 => "verifone_P400", } } diff --git a/src/resources/generated/test_helpers_test_clock.rs b/src/resources/generated/test_helpers_test_clock.rs index da2f8bbf6..dee01b3b0 100644 --- a/src/resources/generated/test_helpers_test_clock.rs +++ b/src/resources/generated/test_helpers_test_clock.rs @@ -42,6 +42,9 @@ pub struct TestHelpersTestClock { /// The status of the Test Clock. #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub status_details: Option, } impl Object for TestHelpersTestClock { @@ -54,6 +57,18 @@ impl Object for TestHelpersTestClock { } } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingClocksResourceStatusDetailsStatusDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub advancing: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct BillingClocksResourceStatusDetailsAdvancingStatusDetails { + /// The `frozen_time` that the Test Clock is advancing towards. + pub target_frozen_time: Timestamp, +} + /// 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")] diff --git a/src/resources/generated/token.rs b/src/resources/generated/token.rs index 4f16f3ad4..6005be29b 100644 --- a/src/resources/generated/token.rs +++ b/src/resources/generated/token.rs @@ -47,7 +47,7 @@ impl Token { /// 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). + /// To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where controller.requirement_collection is `application`, which includes Custom accounts. pub fn create(client: &Client, params: CreateToken<'_>) -> Response { #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/tokens", ¶ms) @@ -135,7 +135,7 @@ pub struct CreateTokenAccount { #[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). + /// Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](/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")] @@ -150,7 +150,7 @@ pub struct CreateTokenCvcUpdate { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateTokenPerson { - /// Details on the legal guardian's acceptance of the required Stripe agreements. + /// Details on the legal guardian's or authorizer's acceptance of the required Stripe agreements. #[serde(skip_serializing_if = "Option::is_none")] pub additional_tos_acceptances: Option, @@ -201,14 +201,14 @@ pub struct CreateTokenPerson { /// 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). + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/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). + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). #[serde(skip_serializing_if = "Option::is_none")] pub id_number_secondary: Option, @@ -522,6 +522,20 @@ pub struct CreditCardSpecs { /// Cardholder's full name. #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, + /// Contains information about card networks used to process the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option, /// The card number, as a string without any separators. pub number: String, } + +/// Contains information about card networks used to process the payment. +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct Networks { + /// The customer's preferred card network for co-branded cards. + /// + /// Supports `cartes_bancaires`, `mastercard`, or `visa`. + /// Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred: Option, +} diff --git a/src/resources/generated/transfer.rs b/src/resources/generated/transfer.rs index ebe462785..e6dfe0259 100644 --- a/src/resources/generated/transfer.rs +++ b/src/resources/generated/transfer.rs @@ -62,7 +62,7 @@ pub struct Transfer { /// 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. + /// ID of the charge that was used to fund the transfer. /// /// If null, the transfer was funded from the available balance. pub source_transaction: Option>, @@ -132,7 +132,9 @@ pub struct CreateTransfer<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub amount: Option, - /// 3-letter [ISO code for currency](https://stripe.com/docs/payouts). + /// Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. + /// + /// Must be a [supported currency](https://docs.stripe.com/currencies). pub currency: Currency, /// An arbitrary string attached to the object. @@ -198,6 +200,7 @@ impl<'a> CreateTransfer<'a> { /// The parameters for `Transfer::list`. #[derive(Clone, Debug, Serialize, Default)] pub struct ListTransfers<'a> { + /// Only return transfers that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option>, diff --git a/src/resources/generated/treasury_financial_account.rs b/src/resources/generated/treasury_financial_account.rs index 7e986bfc6..590b4c237 100644 --- a/src/resources/generated/treasury_financial_account.rs +++ b/src/resources/generated/treasury_financial_account.rs @@ -109,6 +109,7 @@ pub struct TreasuryFinancialAccountsResourceAbaRecord { pub account_holder_name: String, /// The account number. + #[serde(skip_serializing_if = "Option::is_none")] pub account_number: Option, /// The last four characters of the account number. @@ -153,6 +154,8 @@ pub enum TreasuryFinancialAccountActiveFeatures { DepositInsurance, #[serde(rename = "financial_addresses.aba")] FinancialAddressesAba, + #[serde(rename = "financial_addresses.aba.forwarding")] + FinancialAddressesAbaForwarding, #[serde(rename = "inbound_transfers.ach")] InboundTransfersAch, IntraStripeFlows, @@ -173,6 +176,7 @@ impl TreasuryFinancialAccountActiveFeatures { TreasuryFinancialAccountActiveFeatures::CardIssuing => "card_issuing", TreasuryFinancialAccountActiveFeatures::DepositInsurance => "deposit_insurance", TreasuryFinancialAccountActiveFeatures::FinancialAddressesAba => "financial_addresses.aba", + TreasuryFinancialAccountActiveFeatures::FinancialAddressesAbaForwarding => "financial_addresses.aba.forwarding", TreasuryFinancialAccountActiveFeatures::InboundTransfersAch => "inbound_transfers.ach", TreasuryFinancialAccountActiveFeatures::IntraStripeFlows => "intra_stripe_flows", TreasuryFinancialAccountActiveFeatures::OutboundPaymentsAch => "outbound_payments.ach", @@ -209,6 +213,8 @@ pub enum TreasuryFinancialAccountPendingFeatures { DepositInsurance, #[serde(rename = "financial_addresses.aba")] FinancialAddressesAba, + #[serde(rename = "financial_addresses.aba.forwarding")] + FinancialAddressesAbaForwarding, #[serde(rename = "inbound_transfers.ach")] InboundTransfersAch, IntraStripeFlows, @@ -229,6 +235,7 @@ impl TreasuryFinancialAccountPendingFeatures { TreasuryFinancialAccountPendingFeatures::CardIssuing => "card_issuing", TreasuryFinancialAccountPendingFeatures::DepositInsurance => "deposit_insurance", TreasuryFinancialAccountPendingFeatures::FinancialAddressesAba => "financial_addresses.aba", + TreasuryFinancialAccountPendingFeatures::FinancialAddressesAbaForwarding => "financial_addresses.aba.forwarding", TreasuryFinancialAccountPendingFeatures::InboundTransfersAch => "inbound_transfers.ach", TreasuryFinancialAccountPendingFeatures::IntraStripeFlows => "intra_stripe_flows", TreasuryFinancialAccountPendingFeatures::OutboundPaymentsAch => "outbound_payments.ach", @@ -265,6 +272,8 @@ pub enum TreasuryFinancialAccountRestrictedFeatures { DepositInsurance, #[serde(rename = "financial_addresses.aba")] FinancialAddressesAba, + #[serde(rename = "financial_addresses.aba.forwarding")] + FinancialAddressesAbaForwarding, #[serde(rename = "inbound_transfers.ach")] InboundTransfersAch, IntraStripeFlows, @@ -285,6 +294,7 @@ impl TreasuryFinancialAccountRestrictedFeatures { TreasuryFinancialAccountRestrictedFeatures::CardIssuing => "card_issuing", TreasuryFinancialAccountRestrictedFeatures::DepositInsurance => "deposit_insurance", TreasuryFinancialAccountRestrictedFeatures::FinancialAddressesAba => "financial_addresses.aba", + TreasuryFinancialAccountRestrictedFeatures::FinancialAddressesAbaForwarding => "financial_addresses.aba.forwarding", TreasuryFinancialAccountRestrictedFeatures::InboundTransfersAch => "inbound_transfers.ach", TreasuryFinancialAccountRestrictedFeatures::IntraStripeFlows => "intra_stripe_flows", TreasuryFinancialAccountRestrictedFeatures::OutboundPaymentsAch => "outbound_payments.ach", diff --git a/src/resources/generated/treasury_inbound_transfer.rs b/src/resources/generated/treasury_inbound_transfer.rs index d8c2013bc..4092eaaec 100644 --- a/src/resources/generated/treasury_inbound_transfer.rs +++ b/src/resources/generated/treasury_inbound_transfer.rs @@ -4,7 +4,7 @@ use crate::ids::{TreasuryInboundTransferId}; use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasurySharedResourceBillingDetails, TreasuryTransaction}; +use crate::resources::{Currency, Mandate, TreasurySharedResourceBillingDetails, TreasuryTransaction}; use serde::{Deserialize, Serialize}; /// The resource representing a Stripe "TreasuryInboundTransfersResourceInboundTransfer". @@ -127,7 +127,13 @@ pub struct InboundTransfersPaymentMethodDetailsUsBankAccount { /// Last four digits of the bank account number. pub last4: Option, - /// The US bank account network used to debit funds. + /// ID of the mandate used to make this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option>, + + /// The network rails used. + /// + /// See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. pub network: InboundTransfersPaymentMethodDetailsUsBankAccountNetwork, /// Routing number of the bank account. diff --git a/src/resources/generated/treasury_outbound_payment.rs b/src/resources/generated/treasury_outbound_payment.rs index 5e9a7826f..1df04a6fb 100644 --- a/src/resources/generated/treasury_outbound_payment.rs +++ b/src/resources/generated/treasury_outbound_payment.rs @@ -4,7 +4,7 @@ use crate::ids::{TreasuryOutboundPaymentId}; use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasurySharedResourceBillingDetails, TreasuryTransaction}; +use crate::resources::{Currency, Mandate, TreasurySharedResourceBillingDetails, TreasuryTransaction}; use serde::{Deserialize, Serialize}; /// The resource representing a Stripe "TreasuryOutboundPaymentsResourceOutboundPayment". @@ -82,6 +82,9 @@ pub struct TreasuryOutboundPayment { pub status_transitions: TreasuryOutboundPaymentsResourceOutboundPaymentResourceStatusTransitions, + /// Details about network-specific tracking information if available. + pub tracking_details: Option, + /// The Transaction associated with this object. pub transaction: Expandable, } @@ -144,7 +147,13 @@ pub struct OutboundPaymentsPaymentMethodDetailsUsBankAccount { /// Last four digits of the bank account number. pub last4: Option, - /// The US bank account network used to send funds. + /// ID of the mandate used to make this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option>, + + /// The network rails used. + /// + /// See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. pub network: OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork, /// Routing number of the bank account. @@ -183,6 +192,27 @@ pub struct TreasuryOutboundPaymentsResourceOutboundPaymentResourceStatusTransiti pub returned_at: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TreasuryOutboundPaymentsResourceOutboundPaymentResourceTrackingDetails { + + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + + /// The US bank account network used to send funds. + #[serde(rename = "type")] + pub type_: TreasuryOutboundPaymentsResourceOutboundPaymentResourceTrackingDetailsType, + + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TreasuryOutboundPaymentsResourceAchTrackingDetails { + + /// ACH trace ID of the OutboundPayment for payments sent over the `ach` network. + pub trace_id: String, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct TreasuryOutboundPaymentsResourceReturnedStatus { @@ -193,6 +223,19 @@ pub struct TreasuryOutboundPaymentsResourceReturnedStatus { pub transaction: Expandable, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TreasuryOutboundPaymentsResourceUsDomesticWireTrackingDetails { + + /// CHIPS System Sequence Number (SSN) of the OutboundPayment for payments sent over the `us_domestic_wire` network. + pub chips: Option, + + /// IMAD of the OutboundPayment for payments sent over the `us_domestic_wire` network. + pub imad: Option, + + /// OMAD of the OutboundPayment for payments sent over the `us_domestic_wire` network. + pub omad: Option, +} + /// 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")] @@ -401,6 +444,40 @@ impl std::default::Default for TreasuryOutboundPaymentStatus { } } +/// An enum representing the possible values of an `TreasuryOutboundPaymentsResourceOutboundPaymentResourceTrackingDetails`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TreasuryOutboundPaymentsResourceOutboundPaymentResourceTrackingDetailsType { + Ach, + UsDomesticWire, +} + +impl TreasuryOutboundPaymentsResourceOutboundPaymentResourceTrackingDetailsType { + pub fn as_str(self) -> &'static str { + match self { + TreasuryOutboundPaymentsResourceOutboundPaymentResourceTrackingDetailsType::Ach => "ach", + TreasuryOutboundPaymentsResourceOutboundPaymentResourceTrackingDetailsType::UsDomesticWire => "us_domestic_wire", + } + } +} + +impl AsRef for TreasuryOutboundPaymentsResourceOutboundPaymentResourceTrackingDetailsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TreasuryOutboundPaymentsResourceOutboundPaymentResourceTrackingDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TreasuryOutboundPaymentsResourceOutboundPaymentResourceTrackingDetailsType { + fn default() -> Self { + Self::Ach + } +} + /// 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")] diff --git a/src/resources/generated/treasury_outbound_payment_tracking_details_updated.rs b/src/resources/generated/treasury_outbound_payment_tracking_details_updated.rs new file mode 100644 index 000000000..164983ec8 --- /dev/null +++ b/src/resources/generated/treasury_outbound_payment_tracking_details_updated.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "treasury.outbound_payment.tracking_details_updated". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TreasuryOutboundPaymentTrackingDetailsUpdated { +} diff --git a/src/resources/generated/treasury_outbound_transfer.rs b/src/resources/generated/treasury_outbound_transfer.rs index 1db7b7dde..1bc7c18ac 100644 --- a/src/resources/generated/treasury_outbound_transfer.rs +++ b/src/resources/generated/treasury_outbound_transfer.rs @@ -4,7 +4,7 @@ use crate::ids::{TreasuryOutboundTransferId}; use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasurySharedResourceBillingDetails, TreasuryTransaction}; +use crate::resources::{Currency, Mandate, TreasurySharedResourceBillingDetails, TreasuryTransaction}; use serde::{Deserialize, Serialize}; /// The resource representing a Stripe "TreasuryOutboundTransfersResourceOutboundTransfer". @@ -73,6 +73,9 @@ pub struct TreasuryOutboundTransfer { pub status_transitions: TreasuryOutboundTransfersResourceStatusTransitions, + /// Details about network-specific tracking information if available. + pub tracking_details: Option, + /// The Transaction associated with this object. pub transaction: Expandable, } @@ -122,13 +125,40 @@ pub struct OutboundTransfersPaymentMethodDetailsUsBankAccount { /// Last four digits of the bank account number. pub last4: Option, - /// The US bank account network used to send funds. + /// ID of the mandate used to make this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option>, + + /// The network rails used. + /// + /// See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. pub network: OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork, /// Routing number of the bank account. pub routing_number: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TreasuryOutboundTransfersResourceOutboundTransferResourceTrackingDetails { + + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + + /// The US bank account network used to send funds. + #[serde(rename = "type")] + pub type_: TreasuryOutboundTransfersResourceOutboundTransferResourceTrackingDetailsType, + + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TreasuryOutboundTransfersResourceAchTrackingDetails { + + /// ACH trace ID of the OutboundTransfer for transfers sent over the `ach` network. + pub trace_id: String, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct TreasuryOutboundTransfersResourceReturnedDetails { @@ -155,6 +185,19 @@ pub struct TreasuryOutboundTransfersResourceStatusTransitions { pub returned_at: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TreasuryOutboundTransfersResourceUsDomesticWireTrackingDetails { + + /// CHIPS System Sequence Number (SSN) of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + pub chips: Option, + + /// IMAD of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + pub imad: Option, + + /// OMAD of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + pub omad: 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")] @@ -329,6 +372,40 @@ impl std::default::Default for TreasuryOutboundTransferStatus { } } +/// An enum representing the possible values of an `TreasuryOutboundTransfersResourceOutboundTransferResourceTrackingDetails`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TreasuryOutboundTransfersResourceOutboundTransferResourceTrackingDetailsType { + Ach, + UsDomesticWire, +} + +impl TreasuryOutboundTransfersResourceOutboundTransferResourceTrackingDetailsType { + pub fn as_str(self) -> &'static str { + match self { + TreasuryOutboundTransfersResourceOutboundTransferResourceTrackingDetailsType::Ach => "ach", + TreasuryOutboundTransfersResourceOutboundTransferResourceTrackingDetailsType::UsDomesticWire => "us_domestic_wire", + } + } +} + +impl AsRef for TreasuryOutboundTransfersResourceOutboundTransferResourceTrackingDetailsType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TreasuryOutboundTransfersResourceOutboundTransferResourceTrackingDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TreasuryOutboundTransfersResourceOutboundTransferResourceTrackingDetailsType { + fn default() -> Self { + Self::Ach + } +} + /// 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")] diff --git a/src/resources/generated/treasury_outbound_transfer_tracking_details_updated.rs b/src/resources/generated/treasury_outbound_transfer_tracking_details_updated.rs new file mode 100644 index 000000000..f4f6d431a --- /dev/null +++ b/src/resources/generated/treasury_outbound_transfer_tracking_details_updated.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "treasury.outbound_transfer.tracking_details_updated". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TreasuryOutboundTransferTrackingDetailsUpdated { +} diff --git a/src/resources/generated/treasury_received_credit.rs b/src/resources/generated/treasury_received_credit.rs index bebaebd7f..636d8fa04 100644 --- a/src/resources/generated/treasury_received_credit.rs +++ b/src/resources/generated/treasury_received_credit.rs @@ -94,6 +94,7 @@ pub struct TreasuryReceivedCreditsResourceLinkedFlows { pub source_flow: Option, /// The expandable object of the source flow. + #[serde(skip_serializing_if = "Option::is_none")] pub source_flow_details: Option, /// The type of flow that originated the ReceivedCredit (for example, `outbound_payment`). @@ -133,6 +134,7 @@ pub struct TreasuryReceivedCreditsResourceSourceFlowsDetails { pub enum TreasuryReceivedCreditFailureCode { AccountClosed, AccountFrozen, + InternationalTransaction, Other, } @@ -141,6 +143,7 @@ impl TreasuryReceivedCreditFailureCode { match self { TreasuryReceivedCreditFailureCode::AccountClosed => "account_closed", TreasuryReceivedCreditFailureCode::AccountFrozen => "account_frozen", + TreasuryReceivedCreditFailureCode::InternationalTransaction => "international_transaction", TreasuryReceivedCreditFailureCode::Other => "other", } } diff --git a/src/resources/generated/treasury_received_debit.rs b/src/resources/generated/treasury_received_debit.rs index 3ef80636a..7e4bfd68a 100644 --- a/src/resources/generated/treasury_received_debit.rs +++ b/src/resources/generated/treasury_received_debit.rs @@ -90,6 +90,9 @@ pub struct TreasuryReceivedDebitsResourceLinkedFlows { /// Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. pub issuing_transaction: Option, + + /// Set if the ReceivedDebit was created due to a [Payout](https://stripe.com/docs/api#payouts) object. + pub payout: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -109,6 +112,7 @@ pub enum TreasuryReceivedDebitFailureCode { AccountClosed, AccountFrozen, InsufficientFunds, + InternationalTransaction, Other, } @@ -118,6 +122,7 @@ impl TreasuryReceivedDebitFailureCode { TreasuryReceivedDebitFailureCode::AccountClosed => "account_closed", TreasuryReceivedDebitFailureCode::AccountFrozen => "account_frozen", TreasuryReceivedDebitFailureCode::InsufficientFunds => "insufficient_funds", + TreasuryReceivedDebitFailureCode::InternationalTransaction => "international_transaction", TreasuryReceivedDebitFailureCode::Other => "other", } } diff --git a/src/resources/generated/treasury_transaction.rs b/src/resources/generated/treasury_transaction.rs index d90664367..189b6474a 100644 --- a/src/resources/generated/treasury_transaction.rs +++ b/src/resources/generated/treasury_transaction.rs @@ -36,6 +36,7 @@ pub struct TreasuryTransaction { /// A list of TransactionEntries that are part of this Transaction. /// /// This cannot be expanded in any list endpoints. + #[serde(skip_serializing_if = "Option::is_none")] pub entries: Option>, /// The FinancialAccount associated with this object. @@ -45,6 +46,7 @@ pub struct TreasuryTransaction { pub flow: Option, /// Details of the flow that created the Transaction. + #[serde(skip_serializing_if = "Option::is_none")] pub flow_details: Option, /// Type of the flow that created the Transaction. diff --git a/src/resources/generated/treasury_transaction_entry.rs b/src/resources/generated/treasury_transaction_entry.rs index dab4d7839..a542ede2e 100644 --- a/src/resources/generated/treasury_transaction_entry.rs +++ b/src/resources/generated/treasury_transaction_entry.rs @@ -35,6 +35,7 @@ pub struct TreasuryTransactionEntry { pub flow: Option, /// Details of the flow associated with the TransactionEntry. + #[serde(skip_serializing_if = "Option::is_none")] pub flow_details: Option, /// Type of the flow associated with the TransactionEntry. diff --git a/src/resources/generated/usage_record_summary.rs b/src/resources/generated/usage_record_summary.rs index db45835c7..58c3343d5 100644 --- a/src/resources/generated/usage_record_summary.rs +++ b/src/resources/generated/usage_record_summary.rs @@ -8,6 +8,8 @@ use crate::ids::UsageRecordSummaryId; use crate::params::{Object, Timestamp}; /// The resource representing a Stripe "UsageRecordSummary". +/// +/// For more details see #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UsageRecordSummary { /// Unique identifier for the object. diff --git a/src/resources/generated/version.rs b/src/resources/generated/version.rs index 3cdd9f3fe..110ce47f7 100644 --- a/src/resources/generated/version.rs +++ b/src/resources/generated/version.rs @@ -1,3 +1,3 @@ use crate::ApiVersion; -pub const VERSION: ApiVersion = ApiVersion::V2023_10_16; +pub const VERSION: ApiVersion = ApiVersion::V2024_09_30.acacia; diff --git a/src/resources/generated/webhook_endpoint.rs b/src/resources/generated/webhook_endpoint.rs index dc8f5261e..a294db0ea 100644 --- a/src/resources/generated/webhook_endpoint.rs +++ b/src/resources/generated/webhook_endpoint.rs @@ -55,7 +55,7 @@ pub struct WebhookEndpoint { #[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). + /// The endpoint's secret, used to generate [webhook signatures](https://docs.stripe.com/webhooks/signatures). /// /// Only returned at creation. #[serde(skip_serializing_if = "Option::is_none")] @@ -297,6 +297,8 @@ pub enum EventFilter { ApplicationFeeRefunded, #[serde(rename = "balance.available")] BalanceAvailable, + #[serde(rename = "billing.alert.triggered")] + BillingAlertTriggered, #[serde(rename = "billing_portal.configuration.created")] BillingPortalConfigurationCreated, #[serde(rename = "billing_portal.configuration.updated")] @@ -411,6 +413,8 @@ pub enum EventFilter { CustomerUpdated, #[serde(rename = "customer_cash_balance_transaction.created")] CustomerCashBalanceTransactionCreated, + #[serde(rename = "entitlements.active_entitlement_summary.updated")] + EntitlementsActiveEntitlementSummaryUpdated, #[serde(rename = "file.created")] FileCreated, #[serde(rename = "financial_connections.account.created")] @@ -423,6 +427,8 @@ pub enum EventFilter { FinancialConnectionsAccountReactivated, #[serde(rename = "financial_connections.account.refreshed_balance")] FinancialConnectionsAccountRefreshedBalance, + #[serde(rename = "financial_connections.account.refreshed_ownership")] + FinancialConnectionsAccountRefreshedOwnership, #[serde(rename = "financial_connections.account.refreshed_transactions")] FinancialConnectionsAccountRefreshedTransactions, #[serde(rename = "identity.verification_session.canceled")] @@ -447,6 +453,8 @@ pub enum EventFilter { InvoiceFinalized, #[serde(rename = "invoice.marked_uncollectible")] InvoiceMarkedUncollectible, + #[serde(rename = "invoice.overdue")] + InvoiceOverdue, #[serde(rename = "invoice.paid")] InvoicePaid, #[serde(rename = "invoice.payment_action_required")] @@ -463,6 +471,8 @@ pub enum EventFilter { InvoiceUpdated, #[serde(rename = "invoice.voided")] InvoiceVoided, + #[serde(rename = "invoice.will_be_due")] + InvoiceWillBeDue, #[serde(rename = "invoiceitem.created")] InvoiceitemCreated, #[serde(rename = "invoiceitem.deleted")] @@ -487,10 +497,20 @@ pub enum EventFilter { IssuingDisputeCreated, #[serde(rename = "issuing_dispute.funds_reinstated")] IssuingDisputeFundsReinstated, + #[serde(rename = "issuing_dispute.funds_rescinded")] + IssuingDisputeFundsRescinded, #[serde(rename = "issuing_dispute.submitted")] IssuingDisputeSubmitted, #[serde(rename = "issuing_dispute.updated")] IssuingDisputeUpdated, + #[serde(rename = "issuing_personalization_design.activated")] + IssuingPersonalizationDesignActivated, + #[serde(rename = "issuing_personalization_design.deactivated")] + IssuingPersonalizationDesignDeactivated, + #[serde(rename = "issuing_personalization_design.rejected")] + IssuingPersonalizationDesignRejected, + #[serde(rename = "issuing_personalization_design.updated")] + IssuingPersonalizationDesignUpdated, #[serde(rename = "issuing_token.created")] IssuingTokenCreated, #[serde(rename = "issuing_token.updated")] @@ -707,6 +727,8 @@ pub enum EventFilter { TreasuryOutboundPaymentPosted, #[serde(rename = "treasury.outbound_payment.returned")] TreasuryOutboundPaymentReturned, + #[serde(rename = "treasury.outbound_payment.tracking_details_updated")] + TreasuryOutboundPaymentTrackingDetailsUpdated, #[serde(rename = "treasury.outbound_transfer.canceled")] TreasuryOutboundTransferCanceled, #[serde(rename = "treasury.outbound_transfer.created")] @@ -719,6 +741,8 @@ pub enum EventFilter { TreasuryOutboundTransferPosted, #[serde(rename = "treasury.outbound_transfer.returned")] TreasuryOutboundTransferReturned, + #[serde(rename = "treasury.outbound_transfer.tracking_details_updated")] + TreasuryOutboundTransferTrackingDetailsUpdated, #[serde(rename = "treasury.received_credit.created")] TreasuryReceivedCreditCreated, #[serde(rename = "treasury.received_credit.failed")] @@ -743,6 +767,7 @@ impl EventFilter { EventFilter::ApplicationFeeRefundUpdated => "application_fee.refund.updated", EventFilter::ApplicationFeeRefunded => "application_fee.refunded", EventFilter::BalanceAvailable => "balance.available", + EventFilter::BillingAlertTriggered => "billing.alert.triggered", EventFilter::BillingPortalConfigurationCreated => { "billing_portal.configuration.created" } @@ -814,6 +839,9 @@ impl EventFilter { EventFilter::CustomerCashBalanceTransactionCreated => { "customer_cash_balance_transaction.created" } + EventFilter::EntitlementsActiveEntitlementSummaryUpdated => { + "entitlements.active_entitlement_summary.updated" + } EventFilter::FileCreated => "file.created", EventFilter::FinancialConnectionsAccountCreated => { "financial_connections.account.created" @@ -830,6 +858,9 @@ impl EventFilter { EventFilter::FinancialConnectionsAccountRefreshedBalance => { "financial_connections.account.refreshed_balance" } + EventFilter::FinancialConnectionsAccountRefreshedOwnership => { + "financial_connections.account.refreshed_ownership" + } EventFilter::FinancialConnectionsAccountRefreshedTransactions => { "financial_connections.account.refreshed_transactions" } @@ -856,6 +887,7 @@ impl EventFilter { EventFilter::InvoiceFinalizationFailed => "invoice.finalization_failed", EventFilter::InvoiceFinalized => "invoice.finalized", EventFilter::InvoiceMarkedUncollectible => "invoice.marked_uncollectible", + EventFilter::InvoiceOverdue => "invoice.overdue", EventFilter::InvoicePaid => "invoice.paid", EventFilter::InvoicePaymentActionRequired => "invoice.payment_action_required", EventFilter::InvoicePaymentFailed => "invoice.payment_failed", @@ -864,6 +896,7 @@ impl EventFilter { EventFilter::InvoiceUpcoming => "invoice.upcoming", EventFilter::InvoiceUpdated => "invoice.updated", EventFilter::InvoiceVoided => "invoice.voided", + EventFilter::InvoiceWillBeDue => "invoice.will_be_due", EventFilter::InvoiceitemCreated => "invoiceitem.created", EventFilter::InvoiceitemDeleted => "invoiceitem.deleted", EventFilter::IssuingAuthorizationCreated => "issuing_authorization.created", @@ -876,8 +909,21 @@ impl EventFilter { EventFilter::IssuingDisputeClosed => "issuing_dispute.closed", EventFilter::IssuingDisputeCreated => "issuing_dispute.created", EventFilter::IssuingDisputeFundsReinstated => "issuing_dispute.funds_reinstated", + EventFilter::IssuingDisputeFundsRescinded => "issuing_dispute.funds_rescinded", EventFilter::IssuingDisputeSubmitted => "issuing_dispute.submitted", EventFilter::IssuingDisputeUpdated => "issuing_dispute.updated", + EventFilter::IssuingPersonalizationDesignActivated => { + "issuing_personalization_design.activated" + } + EventFilter::IssuingPersonalizationDesignDeactivated => { + "issuing_personalization_design.deactivated" + } + EventFilter::IssuingPersonalizationDesignRejected => { + "issuing_personalization_design.rejected" + } + EventFilter::IssuingPersonalizationDesignUpdated => { + "issuing_personalization_design.updated" + } EventFilter::IssuingTokenCreated => "issuing_token.created", EventFilter::IssuingTokenUpdated => "issuing_token.updated", EventFilter::IssuingTransactionCreated => "issuing_transaction.created", @@ -998,6 +1044,9 @@ impl EventFilter { EventFilter::TreasuryOutboundPaymentFailed => "treasury.outbound_payment.failed", EventFilter::TreasuryOutboundPaymentPosted => "treasury.outbound_payment.posted", EventFilter::TreasuryOutboundPaymentReturned => "treasury.outbound_payment.returned", + EventFilter::TreasuryOutboundPaymentTrackingDetailsUpdated => { + "treasury.outbound_payment.tracking_details_updated" + } EventFilter::TreasuryOutboundTransferCanceled => "treasury.outbound_transfer.canceled", EventFilter::TreasuryOutboundTransferCreated => "treasury.outbound_transfer.created", EventFilter::TreasuryOutboundTransferExpectedArrivalDateUpdated => { @@ -1006,6 +1055,9 @@ impl EventFilter { EventFilter::TreasuryOutboundTransferFailed => "treasury.outbound_transfer.failed", EventFilter::TreasuryOutboundTransferPosted => "treasury.outbound_transfer.posted", EventFilter::TreasuryOutboundTransferReturned => "treasury.outbound_transfer.returned", + EventFilter::TreasuryOutboundTransferTrackingDetailsUpdated => { + "treasury.outbound_transfer.tracking_details_updated" + } EventFilter::TreasuryReceivedCreditCreated => "treasury.received_credit.created", EventFilter::TreasuryReceivedCreditFailed => "treasury.received_credit.failed", EventFilter::TreasuryReceivedCreditSucceeded => "treasury.received_credit.succeeded",