diff --git a/openapi/version.json b/openapi/version.json index aa1a21c90..f166353cc 100644 --- a/openapi/version.json +++ b/openapi/version.json @@ -1,3 +1,3 @@ { - "version": "v484" + "version": "v516" } \ No newline at end of file diff --git a/src/resources/generated/account_session.rs b/src/resources/generated/account_session.rs new file mode 100644 index 000000000..f93f9600d --- /dev/null +++ b/src/resources/generated/account_session.rs @@ -0,0 +1,104 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::client::{Client, Response}; +use crate::ids::{AccountId}; +use crate::params::{Expand, Object, Timestamp}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "ConnectEmbeddedMethodAccountSessionCreateMethodAccountSession". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct AccountSession { + + /// The ID of the account the AccountSession was created for. + pub account: String, + + /// The client secret of this AccountSession. + /// + /// Used on the client to set up secure access to the given `account`. The client secret can be used to provide access to `account` from your frontend. + /// It should not be stored, logged, or exposed to anyone other than the connected account. + /// Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled. + pub client_secret: String, + + pub components: ConnectEmbeddedAccountSessionCreateComponents, + + /// The timestamp at which this AccountSession will expire. + pub expires_at: Timestamp, + + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, +} + +impl AccountSession { + + /// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. + pub fn create(client: &Client, params: CreateAccountSession<'_>) -> Response { + client.post_form("/account_sessions", ¶ms) + } +} + +impl Object for AccountSession { + type Id = (); + fn id(&self) -> Self::Id {} + fn object(&self) -> &'static str { + "account_session" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConnectEmbeddedAccountSessionCreateComponents { + + pub account_onboarding: ConnectEmbeddedBaseConfig, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConnectEmbeddedBaseConfig { + + /// Whether the embedded component is enabled. + pub enabled: bool, +} + +/// The parameters for `AccountSession::create`. +#[derive(Clone, Debug, Serialize)] +pub struct CreateAccountSession<'a> { + + /// The identifier of the account to create an Account Session for. + pub account: AccountId, + + /// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. + /// + /// whether it has been enabled or not). + pub components: CreateAccountSessionComponents, + + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Expand::is_empty")] + pub expand: &'a [&'a str], +} + +impl<'a> CreateAccountSession<'a> { + pub fn new(account: AccountId, components: CreateAccountSessionComponents) -> Self { + CreateAccountSession { + account, + components, + expand: Default::default(), + } + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponents { + + /// Configuration for the account onboarding embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_onboarding: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsAccountOnboarding { + + /// Whether the embedded component is enabled. + pub enabled: bool, +} diff --git a/src/resources/generated/balance_transaction.rs b/src/resources/generated/balance_transaction.rs index e4fb6e495..e562bd7b3 100644 --- a/src/resources/generated/balance_transaction.rs +++ b/src/resources/generated/balance_transaction.rs @@ -69,7 +69,7 @@ pub struct BalanceTransaction { /// Either `available` or `pending`. pub status: BalanceTransactionStatus, - /// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + /// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. /// /// [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. /// If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead. @@ -180,7 +180,7 @@ pub struct ListBalanceTransactions<'a> { /// Only returns transactions of the given type. /// - /// One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + /// One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. #[serde(rename = "type")] #[serde(skip_serializing_if = "Option::is_none")] pub type_: Option<&'a str>, @@ -224,6 +224,12 @@ pub enum BalanceTransactionType { IssuingAuthorizationRelease, IssuingDispute, IssuingTransaction, + ObligationInbound, + ObligationOutbound, + ObligationPayout, + ObligationPayoutFailure, + ObligationReversalInbound, + ObligationReversalOutbound, Payment, PaymentFailureRefund, PaymentRefund, @@ -262,6 +268,12 @@ impl BalanceTransactionType { BalanceTransactionType::IssuingAuthorizationRelease => "issuing_authorization_release", BalanceTransactionType::IssuingDispute => "issuing_dispute", BalanceTransactionType::IssuingTransaction => "issuing_transaction", + BalanceTransactionType::ObligationInbound => "obligation_inbound", + BalanceTransactionType::ObligationOutbound => "obligation_outbound", + BalanceTransactionType::ObligationPayout => "obligation_payout", + BalanceTransactionType::ObligationPayoutFailure => "obligation_payout_failure", + BalanceTransactionType::ObligationReversalInbound => "obligation_reversal_inbound", + BalanceTransactionType::ObligationReversalOutbound => "obligation_reversal_outbound", BalanceTransactionType::Payment => "payment", BalanceTransactionType::PaymentFailureRefund => "payment_failure_refund", BalanceTransactionType::PaymentRefund => "payment_refund", diff --git a/src/resources/generated/bank_account.rs b/src/resources/generated/bank_account.rs index db3771ff5..f85579243 100644 --- a/src/resources/generated/bank_account.rs +++ b/src/resources/generated/bank_account.rs @@ -70,7 +70,7 @@ pub struct BankAccount { #[serde(skip_serializing_if = "Option::is_none")] pub fingerprint: Option, - /// Information about upcoming new requirements for the bank account, including what information needs to be collected. + /// Information about the [upcoming new requirements for the bank account](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. #[serde(skip_serializing_if = "Option::is_none")] pub future_requirements: Option, diff --git a/src/resources/generated/charge.rs b/src/resources/generated/charge.rs index 3d55bf462..dfbb6f459 100644 --- a/src/resources/generated/charge.rs +++ b/src/resources/generated/charge.rs @@ -1042,7 +1042,7 @@ pub struct PaymentMethodDetailsGrabpay { pub struct PaymentMethodDetailsIdeal { /// The customer's bank. /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. pub bank: Option, /// The Bank Identifier Code of the customer's bank. @@ -2242,6 +2242,7 @@ pub enum PaymentMethodDetailsIdealBank { Ing, Knab, Moneyou, + N26, Rabobank, Regiobank, Revolut, @@ -2261,6 +2262,7 @@ impl PaymentMethodDetailsIdealBank { PaymentMethodDetailsIdealBank::Ing => "ing", PaymentMethodDetailsIdealBank::Knab => "knab", PaymentMethodDetailsIdealBank::Moneyou => "moneyou", + PaymentMethodDetailsIdealBank::N26 => "n26", PaymentMethodDetailsIdealBank::Rabobank => "rabobank", PaymentMethodDetailsIdealBank::Regiobank => "regiobank", PaymentMethodDetailsIdealBank::Revolut => "revolut", @@ -2311,6 +2313,8 @@ pub enum PaymentMethodDetailsIdealBic { Knabnl2h, #[serde(rename = "MOYONL21")] Moyonl21, + #[serde(rename = "NTSBDEB1")] + Ntsbdeb1, #[serde(rename = "RABONL2U")] Rabonl2u, #[serde(rename = "RBRBNL21")] @@ -2337,6 +2341,7 @@ impl PaymentMethodDetailsIdealBic { PaymentMethodDetailsIdealBic::Ingbnl2a => "INGBNL2A", PaymentMethodDetailsIdealBic::Knabnl2h => "KNABNL2H", PaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21", + PaymentMethodDetailsIdealBic::Ntsbdeb1 => "NTSBDEB1", PaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U", PaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21", PaymentMethodDetailsIdealBic::Revoie23 => "REVOIE23", diff --git a/src/resources/generated/checkout_session.rs b/src/resources/generated/checkout_session.rs index 8469a9f5a..91edf4043 100644 --- a/src/resources/generated/checkout_session.rs +++ b/src/resources/generated/checkout_session.rs @@ -76,7 +76,7 @@ pub struct CheckoutSession { pub custom_text: PaymentPagesCheckoutSessionCustomText, /// The ID of the customer for this Session. - /// For Checkout Sessions in `payment` or `subscription` mode, Checkout + /// For Checkout Sessions in `subscription` mode or Checkout Sessions with `customer_creation` set as `always` in `payment` mode, Checkout /// will create a new customer object based on information provided /// during the payment flow unless an existing customer was provided when /// the Session was created. @@ -1104,7 +1104,7 @@ pub struct CreateCheckoutSession<'a> { /// /// In `payment` mode, the customer’s most recent card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page. /// In `subscription` mode, the customer’s [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) will be used if it’s a card, and otherwise the most recent card will be used. - /// A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. If blank for Checkout Sessions in `payment` or `subscription` mode, Checkout will create a new Customer object based on information provided during the payment flow. You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. + /// A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. If blank for Checkout Sessions in `subscription` mode or with `customer_creation` set as `always` in `payment` mode, Checkout will create a new Customer object based on information provided during the payment flow. You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. #[serde(skip_serializing_if = "Option::is_none")] pub customer: Option, @@ -2704,8 +2704,6 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer pub requested_address_types: Option>, /// The list of bank transfer types that this PaymentIntent is allowed to use for funding. - /// - /// Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. #[serde(rename = "type")] pub type_: CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType, } diff --git a/src/resources/generated/invoice.rs b/src/resources/generated/invoice.rs index f3f29c77f..2b73f0cad 100644 --- a/src/resources/generated/invoice.rs +++ b/src/resources/generated/invoice.rs @@ -97,13 +97,10 @@ pub struct Invoice { /// Indicates the reason why the invoice was created. /// - /// `subscription_cycle` indicates an invoice created by a subscription advancing into a new period. - /// `subscription_create` indicates an invoice created due to creating a subscription. - /// `subscription_update` indicates an invoice created due to updating a subscription. - /// `subscription` is set for all old invoices to indicate either a change to a subscription or a period advancement. - /// `manual` is set for all invoices unrelated to a subscription (for example: created via the invoice editor). - /// The `upcoming` value is reserved for simulated invoices per the upcoming invoice endpoint. - /// `subscription_threshold` indicates an invoice created due to a billing threshold being reached. + /// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. + /// * `subscription`: No longer in use. + /// + /// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * `subscription_create`: A new subscription was created. * `subscription_cycle`: A subscription advanced into a new period. * `subscription_threshold`: A subscription reached a billing threshold. * `subscription_update`: A subscription was updated. * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. #[serde(skip_serializing_if = "Option::is_none")] pub billing_reason: Option, diff --git a/src/resources/generated/payment_intent.rs b/src/resources/generated/payment_intent.rs index afced3728..6808e1ef4 100644 --- a/src/resources/generated/payment_intent.rs +++ b/src/resources/generated/payment_intent.rs @@ -205,9 +205,9 @@ impl PaymentIntent { /// Retrieves the details of a PaymentIntent that has previously been created. /// - /// Client-side retrieval using a publishable key is allowed when the `client_secret` is provided in the query string. - /// When retrieved with a publishable key, only a subset of properties will be returned. - /// Please refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. + /// You can retrieve a PaymentIntent client-side using a publishable key when the `client_secret` is in the query string. + /// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. + /// Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. pub fn retrieve( client: &Client, id: &PaymentIntentId, @@ -4988,6 +4988,7 @@ pub enum CreatePaymentIntentPaymentMethodDataIdealBank { Ing, Knab, Moneyou, + N26, Rabobank, Regiobank, Revolut, @@ -5007,6 +5008,7 @@ impl CreatePaymentIntentPaymentMethodDataIdealBank { CreatePaymentIntentPaymentMethodDataIdealBank::Ing => "ing", CreatePaymentIntentPaymentMethodDataIdealBank::Knab => "knab", CreatePaymentIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", + CreatePaymentIntentPaymentMethodDataIdealBank::N26 => "n26", CreatePaymentIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", CreatePaymentIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", CreatePaymentIntentPaymentMethodDataIdealBank::Revolut => "revolut", @@ -10265,6 +10267,7 @@ pub enum UpdatePaymentIntentPaymentMethodDataIdealBank { Ing, Knab, Moneyou, + N26, Rabobank, Regiobank, Revolut, @@ -10284,6 +10287,7 @@ impl UpdatePaymentIntentPaymentMethodDataIdealBank { UpdatePaymentIntentPaymentMethodDataIdealBank::Ing => "ing", UpdatePaymentIntentPaymentMethodDataIdealBank::Knab => "knab", UpdatePaymentIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", + UpdatePaymentIntentPaymentMethodDataIdealBank::N26 => "n26", UpdatePaymentIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", UpdatePaymentIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", UpdatePaymentIntentPaymentMethodDataIdealBank::Revolut => "revolut", diff --git a/src/resources/generated/payment_link.rs b/src/resources/generated/payment_link.rs index 07a68c3c2..bc18795c2 100644 --- a/src/resources/generated/payment_link.rs +++ b/src/resources/generated/payment_link.rs @@ -8,7 +8,8 @@ use crate::client::{Client, Response}; use crate::ids::PaymentLinkId; use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable}; use crate::resources::{ - Account, CheckoutSessionItem, Currency, InvoiceSettingRenderingOptions, ShippingRate, TaxId, + Account, Application, CheckoutSessionItem, Currency, InvoiceSettingRenderingOptions, + ShippingRate, TaxId, }; /// The resource representing a Stripe "PaymentLink". @@ -29,6 +30,9 @@ pub struct PaymentLink { /// Whether user redeemable promotion codes are enabled. pub allow_promotion_codes: bool, + /// The ID of the Connect application that created the Payment Link. + pub application: Option>, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. pub application_fee_amount: Option, diff --git a/src/resources/generated/payment_method.rs b/src/resources/generated/payment_method.rs index e49638dc4..8c71b06ea 100644 --- a/src/resources/generated/payment_method.rs +++ b/src/resources/generated/payment_method.rs @@ -564,7 +564,7 @@ pub struct PaymentMethodGrabpay {} pub struct PaymentMethodIdeal { /// The customer's bank, if provided. /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `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. @@ -1596,6 +1596,7 @@ pub enum CreatePaymentMethodIdealBank { Ing, Knab, Moneyou, + N26, Rabobank, Regiobank, Revolut, @@ -1615,6 +1616,7 @@ impl CreatePaymentMethodIdealBank { CreatePaymentMethodIdealBank::Ing => "ing", CreatePaymentMethodIdealBank::Knab => "knab", CreatePaymentMethodIdealBank::Moneyou => "moneyou", + CreatePaymentMethodIdealBank::N26 => "n26", CreatePaymentMethodIdealBank::Rabobank => "rabobank", CreatePaymentMethodIdealBank::Regiobank => "regiobank", CreatePaymentMethodIdealBank::Revolut => "revolut", @@ -2056,6 +2058,7 @@ pub enum PaymentMethodIdealBank { Ing, Knab, Moneyou, + N26, Rabobank, Regiobank, Revolut, @@ -2075,6 +2078,7 @@ impl PaymentMethodIdealBank { PaymentMethodIdealBank::Ing => "ing", PaymentMethodIdealBank::Knab => "knab", PaymentMethodIdealBank::Moneyou => "moneyou", + PaymentMethodIdealBank::N26 => "n26", PaymentMethodIdealBank::Rabobank => "rabobank", PaymentMethodIdealBank::Regiobank => "regiobank", PaymentMethodIdealBank::Revolut => "revolut", @@ -2125,6 +2129,8 @@ pub enum PaymentMethodIdealBic { Knabnl2h, #[serde(rename = "MOYONL21")] Moyonl21, + #[serde(rename = "NTSBDEB1")] + Ntsbdeb1, #[serde(rename = "RABONL2U")] Rabonl2u, #[serde(rename = "RBRBNL21")] @@ -2151,6 +2157,7 @@ impl PaymentMethodIdealBic { PaymentMethodIdealBic::Ingbnl2a => "INGBNL2A", PaymentMethodIdealBic::Knabnl2h => "KNABNL2H", PaymentMethodIdealBic::Moyonl21 => "MOYONL21", + PaymentMethodIdealBic::Ntsbdeb1 => "NTSBDEB1", PaymentMethodIdealBic::Rabonl2u => "RABONL2U", PaymentMethodIdealBic::Rbrbnl21 => "RBRBNL21", PaymentMethodIdealBic::Revoie23 => "REVOIE23", diff --git a/src/resources/generated/payment_method_domain.rs b/src/resources/generated/payment_method_domain.rs new file mode 100644 index 000000000..5e036da0c --- /dev/null +++ b/src/resources/generated/payment_method_domain.rs @@ -0,0 +1,232 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::client::{Client, Response}; +use crate::ids::{PaymentMethodDomainId}; +use crate::params::{Expand, List, Object, Paginable, Timestamp}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "PaymentMethodDomainResourcePaymentMethodDomain". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodDomain { + /// Unique identifier for the object. + pub id: PaymentMethodDomainId, + + pub apple_pay: PaymentMethodDomainResourcePaymentMethodStatus, + + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: Timestamp, + + /// The domain name that this payment method domain object represents. + pub domain_name: String, + + /// Whether this payment method domain is enabled. + /// + /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + pub enabled: bool, + + pub google_pay: PaymentMethodDomainResourcePaymentMethodStatus, + + pub link: PaymentMethodDomainResourcePaymentMethodStatus, + + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + + pub paypal: PaymentMethodDomainResourcePaymentMethodStatus, +} + +impl PaymentMethodDomain { + + /// Lists the details of existing payment method domains. +pub fn list(client: &Client, params: &ListPaymentMethodDomains<'_>) -> Response> { + client.get_query("/payment_method_domains", ¶ms) +} + + + /// Creates a payment method domain. + pub fn create(client: &Client, params: CreatePaymentMethodDomain<'_>) -> Response { + client.post_form("/payment_method_domains", ¶ms) + } + + /// Retrieves the details of an existing payment method domain. + pub fn retrieve(client: &Client, id: &PaymentMethodDomainId, expand: &[&str]) -> Response { + client.get_query(&format!("/payment_method_domains/{}", id), &Expand { expand }) + } + + /// Updates an existing payment method domain. + pub fn update(client: &Client, id: &PaymentMethodDomainId, params: UpdatePaymentMethodDomain<'_>) -> Response { + client.post_form(&format!("/payment_method_domains/{}", id), ¶ms) + } +} + +impl Object for PaymentMethodDomain { + type Id = PaymentMethodDomainId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "payment_method_domain" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodDomainResourcePaymentMethodStatus { + + /// The status of the payment method on the domain. + pub status: PaymentMethodDomainResourcePaymentMethodStatusStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + pub status_details: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodDomainResourcePaymentMethodStatusDetails { + + /// The error message associated with the status of the payment method on the domain. + pub error_message: String, +} + +/// The parameters for `PaymentMethodDomain::create`. +#[derive(Clone, Debug, Serialize)] +pub struct CreatePaymentMethodDomain<'a> { + + /// The domain name that this payment method domain object represents. + pub domain_name: &'a str, + + /// Whether this payment method domain is enabled. + /// + /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Expand::is_empty")] + pub expand: &'a [&'a str], +} + +impl<'a> CreatePaymentMethodDomain<'a> { + pub fn new(domain_name: &'a str) -> Self { + CreatePaymentMethodDomain { + domain_name, + enabled: Default::default(), + expand: Default::default(), + } + } +} + +/// The parameters for `PaymentMethodDomain::list`. +#[derive(Clone, Debug, Serialize, Default)] +pub struct ListPaymentMethodDomains<'a> { + + /// The domain name that this payment method domain object represents. + #[serde(skip_serializing_if = "Option::is_none")] + pub domain_name: Option<&'a str>, + + /// Whether this payment method domain is enabled. + /// + /// If the domain is not enabled, payment methods will not appear in Elements. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + + /// A cursor for use in pagination. + /// + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option, + + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Expand::is_empty")] + pub expand: &'a [&'a str], + + /// A limit on the number of objects to be returned. + /// + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + + /// A cursor for use in pagination. + /// + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option, +} + +impl<'a> ListPaymentMethodDomains<'a> { + pub fn new() -> Self { + ListPaymentMethodDomains { + domain_name: Default::default(), + enabled: Default::default(), + ending_before: Default::default(), + expand: Default::default(), + limit: Default::default(), + starting_after: Default::default(), + } + } +} +impl Paginable for ListPaymentMethodDomains<'_> { + type O = PaymentMethodDomain; + fn set_last(&mut self, item: Self::O) { + self.starting_after = Some(item.id()); + }} +/// The parameters for `PaymentMethodDomain::update`. +#[derive(Clone, Debug, Serialize, Default)] +pub struct UpdatePaymentMethodDomain<'a> { + + /// Whether this payment method domain is enabled. + /// + /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Expand::is_empty")] + pub expand: &'a [&'a str], +} + +impl<'a> UpdatePaymentMethodDomain<'a> { + pub fn new() -> Self { + UpdatePaymentMethodDomain { + enabled: Default::default(), + expand: Default::default(), + } + } +} + +/// An enum representing the possible values of an `PaymentMethodDomainResourcePaymentMethodStatus`'s `status` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentMethodDomainResourcePaymentMethodStatusStatus { + Active, + Inactive, +} + +impl PaymentMethodDomainResourcePaymentMethodStatusStatus { + pub fn as_str(self) -> &'static str { + match self { + PaymentMethodDomainResourcePaymentMethodStatusStatus::Active => "active", + PaymentMethodDomainResourcePaymentMethodStatusStatus::Inactive => "inactive", + } + } +} + +impl AsRef for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn default() -> Self { + Self::Active + } +} diff --git a/src/resources/generated/person.rs b/src/resources/generated/person.rs index a80f9184a..748626963 100644 --- a/src/resources/generated/person.rs +++ b/src/resources/generated/person.rs @@ -64,7 +64,7 @@ pub struct Person { #[serde(skip_serializing_if = "Option::is_none")] pub full_name_aliases: Option>, - /// Information about the upcoming new requirements for this person, including what information needs to be collected, and by when. + /// Information about the [upcoming new requirements for this person](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. #[serde(skip_serializing_if = "Option::is_none")] pub future_requirements: Option, @@ -73,6 +73,9 @@ pub struct Person { pub gender: Option, /// Whether the person's `id_number` was provided. + /// + /// True if either the full ID number was provided or if only the required part of the ID number was provided (ex. + /// last four of an individual's SSN for the US indicated by `ssn_last_4_provided`). #[serde(skip_serializing_if = "Option::is_none")] pub id_number_provided: Option, diff --git a/src/resources/generated/product.rs b/src/resources/generated/product.rs index 46418c7b1..e57680135 100644 --- a/src/resources/generated/product.rs +++ b/src/resources/generated/product.rs @@ -44,6 +44,12 @@ 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>, @@ -165,6 +171,14 @@ pub struct PackageDimensions { pub width: f64, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ProductFeature { + /// The feature's name. + /// + /// Up to 80 characters long. + pub name: String, +} + /// The parameters for `Product::create`. #[derive(Clone, Debug, Serialize)] pub struct CreateProduct<'a> { @@ -190,6 +204,12 @@ 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. @@ -258,6 +278,7 @@ impl<'a> CreateProduct<'a> { default_price_data: Default::default(), description: Default::default(), expand: Default::default(), + features: Default::default(), id: Default::default(), images: Default::default(), metadata: Default::default(), @@ -371,6 +392,12 @@ 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>, @@ -427,6 +454,7 @@ impl<'a> UpdateProduct<'a> { default_price: Default::default(), description: Default::default(), expand: Default::default(), + features: Default::default(), images: Default::default(), metadata: Default::default(), name: Default::default(), @@ -478,6 +506,22 @@ pub struct CreateProductDefaultPriceData { pub unit_amount_decimal: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateProductFeatures { + /// The feature's name. + /// + /// Up to 80 characters long. + pub name: String, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateProductFeatures { + /// The feature's name. + /// + /// Up to 80 characters long. + pub name: String, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateProductDefaultPriceDataCurrencyOptions { /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. diff --git a/src/resources/generated/setup_attempt.rs b/src/resources/generated/setup_attempt.rs index 314cf12c9..a9b4ca38c 100644 --- a/src/resources/generated/setup_attempt.rs +++ b/src/resources/generated/setup_attempt.rs @@ -282,7 +282,7 @@ pub struct SetupAttemptPaymentMethodDetailsCashapp {} pub struct SetupAttemptPaymentMethodDetailsIdeal { /// The customer's bank. /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. pub bank: Option, /// The Bank Identifier Code of the customer's bank. @@ -542,6 +542,7 @@ pub enum SetupAttemptPaymentMethodDetailsIdealBank { Ing, Knab, Moneyou, + N26, Rabobank, Regiobank, Revolut, @@ -561,6 +562,7 @@ impl SetupAttemptPaymentMethodDetailsIdealBank { SetupAttemptPaymentMethodDetailsIdealBank::Ing => "ing", SetupAttemptPaymentMethodDetailsIdealBank::Knab => "knab", SetupAttemptPaymentMethodDetailsIdealBank::Moneyou => "moneyou", + SetupAttemptPaymentMethodDetailsIdealBank::N26 => "n26", SetupAttemptPaymentMethodDetailsIdealBank::Rabobank => "rabobank", SetupAttemptPaymentMethodDetailsIdealBank::Regiobank => "regiobank", SetupAttemptPaymentMethodDetailsIdealBank::Revolut => "revolut", @@ -611,6 +613,8 @@ pub enum SetupAttemptPaymentMethodDetailsIdealBic { Knabnl2h, #[serde(rename = "MOYONL21")] Moyonl21, + #[serde(rename = "NTSBDEB1")] + Ntsbdeb1, #[serde(rename = "RABONL2U")] Rabonl2u, #[serde(rename = "RBRBNL21")] @@ -637,6 +641,7 @@ impl SetupAttemptPaymentMethodDetailsIdealBic { SetupAttemptPaymentMethodDetailsIdealBic::Ingbnl2a => "INGBNL2A", SetupAttemptPaymentMethodDetailsIdealBic::Knabnl2h => "KNABNL2H", SetupAttemptPaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21", + SetupAttemptPaymentMethodDetailsIdealBic::Ntsbdeb1 => "NTSBDEB1", SetupAttemptPaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U", SetupAttemptPaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21", SetupAttemptPaymentMethodDetailsIdealBic::Revoie23 => "REVOIE23", diff --git a/src/resources/generated/setup_intent.rs b/src/resources/generated/setup_intent.rs index a6f3e5f1f..304453740 100644 --- a/src/resources/generated/setup_intent.rs +++ b/src/resources/generated/setup_intent.rs @@ -2319,6 +2319,7 @@ pub enum CreateSetupIntentPaymentMethodDataIdealBank { Ing, Knab, Moneyou, + N26, Rabobank, Regiobank, Revolut, @@ -2338,6 +2339,7 @@ impl CreateSetupIntentPaymentMethodDataIdealBank { CreateSetupIntentPaymentMethodDataIdealBank::Ing => "ing", CreateSetupIntentPaymentMethodDataIdealBank::Knab => "knab", CreateSetupIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", + CreateSetupIntentPaymentMethodDataIdealBank::N26 => "n26", CreateSetupIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", CreateSetupIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", CreateSetupIntentPaymentMethodDataIdealBank::Revolut => "revolut", @@ -4007,6 +4009,7 @@ pub enum UpdateSetupIntentPaymentMethodDataIdealBank { Ing, Knab, Moneyou, + N26, Rabobank, Regiobank, Revolut, @@ -4026,6 +4029,7 @@ impl UpdateSetupIntentPaymentMethodDataIdealBank { UpdateSetupIntentPaymentMethodDataIdealBank::Ing => "ing", UpdateSetupIntentPaymentMethodDataIdealBank::Knab => "knab", UpdateSetupIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", + UpdateSetupIntentPaymentMethodDataIdealBank::N26 => "n26", UpdateSetupIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", UpdateSetupIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", UpdateSetupIntentPaymentMethodDataIdealBank::Revolut => "revolut", diff --git a/src/resources/generated/subscription.rs b/src/resources/generated/subscription.rs index fda67bfa2..fa6854ef0 100644 --- a/src/resources/generated/subscription.rs +++ b/src/resources/generated/subscription.rs @@ -266,13 +266,13 @@ impl Object for Subscription { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CancellationDetails { - /// Additional comments about why the user canceled the subscription, if the subscription was cancelled explicitly by the user. + /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. pub comment: Option, - /// The customer submitted reason for why they cancelled, if the subscription was cancelled explicitly by the user. + /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. pub feedback: Option, - /// Why this subscription was cancelled. + /// Why this subscription was canceled. pub reason: Option, } @@ -1136,11 +1136,11 @@ pub struct UpdateSubscriptionAutomaticTax { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSubscriptionCancellationDetails { - /// Additional comments about why the user canceled the subscription, if the subscription was cancelled explicitly by the user. + /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, - /// The customer submitted reason for why they cancelled, if the subscription was cancelled explicitly by the user. + /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. #[serde(skip_serializing_if = "Option::is_none")] pub feedback: Option, } diff --git a/src/resources/generated/token.rs b/src/resources/generated/token.rs index 138ad893a..84e621292 100644 --- a/src/resources/generated/token.rs +++ b/src/resources/generated/token.rs @@ -74,6 +74,10 @@ pub struct CreateToken<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub account: Option, + /// The card this token will represent. + /// + /// If you also pass in a customer, the card must be the ID of a card belonging to the customer. + /// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. #[serde(skip_serializing_if = "Option::is_none")] pub card: Option, @@ -438,6 +442,10 @@ impl std::default::Default for CreateTokenAccountBusinessType { } } +/// The card this token will represent. +/// +/// If you also pass in a customer, the card must be the ID of a card belonging to the customer. +/// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(untagged, rename_all = "snake_case")] pub enum CreateTokenCardUnion { @@ -447,25 +455,41 @@ pub enum CreateTokenCardUnion { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreditCardSpecs { + /// City / District / Suburb / Town / Village. #[serde(skip_serializing_if = "Option::is_none")] pub address_city: Option, + /// Billing address country, if provided. #[serde(skip_serializing_if = "Option::is_none")] pub address_country: Option, + /// Address line 1 (Street address / PO Box / Company name). #[serde(skip_serializing_if = "Option::is_none")] pub address_line1: Option, + /// Address line 2 (Apartment / Suite / Unit / Building). #[serde(skip_serializing_if = "Option::is_none")] pub address_line2: Option, + /// State / County / Province / Region. #[serde(skip_serializing_if = "Option::is_none")] pub address_state: Option, + /// ZIP or postal code. #[serde(skip_serializing_if = "Option::is_none")] pub address_zip: Option, + /// Required in order to add the card to an account; in all other cases, this parameter is not used. + /// + /// When added to an account, the card (which must be a debit card) can be used as a transfer destination for funds in this currency. #[serde(skip_serializing_if = "Option::is_none")] pub currency: Option, + /// Card security code. + /// + /// Highly recommended to always include this value. #[serde(skip_serializing_if = "Option::is_none")] pub cvc: Option, + /// Two-digit number representing the card's expiration month. pub exp_month: String, + /// Two- or four-digit number representing the card's expiration year. pub exp_year: String, + /// Cardholder's full name. #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, + /// The card number, as a string without any separators. pub number: String, } diff --git a/src/resources/generated/webhook_endpoint.rs b/src/resources/generated/webhook_endpoint.rs index 868a5717c..ed8d5cfe6 100644 --- a/src/resources/generated/webhook_endpoint.rs +++ b/src/resources/generated/webhook_endpoint.rs @@ -449,8 +449,6 @@ pub enum EventFilter { InvoiceitemCreated, #[serde(rename = "invoiceitem.deleted")] InvoiceitemDeleted, - #[serde(rename = "invoiceitem.updated")] - InvoiceitemUpdated, #[serde(rename = "issuing_authorization.created")] IssuingAuthorizationCreated, #[serde(rename = "issuing_authorization.request")] @@ -850,7 +848,6 @@ impl EventFilter { EventFilter::InvoiceVoided => "invoice.voided", EventFilter::InvoiceitemCreated => "invoiceitem.created", EventFilter::InvoiceitemDeleted => "invoiceitem.deleted", - EventFilter::InvoiceitemUpdated => "invoiceitem.updated", EventFilter::IssuingAuthorizationCreated => "issuing_authorization.created", EventFilter::IssuingAuthorizationRequest => "issuing_authorization.request", EventFilter::IssuingAuthorizationUpdated => "issuing_authorization.updated",