diff --git a/openapi/version.json b/openapi/version.json index e0b1bf1b4..69e796f85 100644 --- a/openapi/version.json +++ b/openapi/version.json @@ -1,3 +1,3 @@ { - "version": "v238" + "version": "v301" } \ No newline at end of file diff --git a/src/resources.rs b/src/resources.rs index b063ac88c..8ee55357d 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -122,6 +122,7 @@ pub use { mandate::*, mandate_options_off_session_details_blik::*, payment_intent::*, + payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code::*, linked_account_options_us_bank_account::*, payment_method_options_customer_balance_eu_bank_account::*, payout::*, diff --git a/src/resources/generated.rs b/src/resources/generated.rs index 24cce3a9c..b605344ab 100644 --- a/src/resources/generated.rs +++ b/src/resources/generated.rs @@ -29,6 +29,7 @@ pub mod core { pub mod mandate; pub mod mandate_options_off_session_details_blik; pub mod payment_intent; + pub mod payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code; pub mod payment_method_options_customer_balance_eu_bank_account; pub mod payout; pub mod platform_tax_fee; diff --git a/src/resources/generated/account.rs b/src/resources/generated/account.rs index afb24566e..294e95977 100644 --- a/src/resources/generated/account.rs +++ b/src/resources/generated/account.rs @@ -251,6 +251,10 @@ pub struct AccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub cartes_bancaires_payments: Option, + /// The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_payments: Option, + /// The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. #[serde(skip_serializing_if = "Option::is_none")] pub eps_payments: Option, @@ -690,6 +694,14 @@ pub struct Company { #[serde(skip_serializing_if = "Option::is_none")] pub executives_provided: Option, + /// The export license ID number of the company, also referred as Import Export Code (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_license_id: Option, + + /// The purpose code to use for export transactions (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_purpose_code: Option, + /// The company's legal name. #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, @@ -1140,6 +1152,14 @@ pub struct CompanyParams { #[serde(skip_serializing_if = "Option::is_none")] pub executives_provided: Option, + /// The export license ID number of the company, also referred as Import Export Code (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_license_id: Option, + + /// The purpose code to use for export transactions (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_purpose_code: Option, + /// The company's legal name. #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, @@ -1247,6 +1267,10 @@ pub struct CreateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub cartes_bancaires_payments: Option, + /// The cashapp_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_payments: Option, + /// The eps_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub eps_payments: Option, @@ -1525,6 +1549,10 @@ pub struct UpdateAccountCapabilities { #[serde(skip_serializing_if = "Option::is_none")] pub cartes_bancaires_payments: Option, + /// The cashapp_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_payments: Option, + /// The eps_payments capability. #[serde(skip_serializing_if = "Option::is_none")] pub eps_payments: Option, @@ -1857,6 +1885,16 @@ pub struct CreateAccountCapabilitiesCartesBancairesPayments { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountCapabilitiesCashappPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateAccountCapabilitiesEpsPayments { /// Passing true requests the capability for the account, if it is not already requested. @@ -2323,6 +2361,16 @@ pub struct UpdateAccountCapabilitiesCartesBancairesPayments { pub requested: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateAccountCapabilitiesCashappPayments { + /// Passing true requests the capability for the account, if it is not already requested. + /// + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateAccountCapabilitiesEpsPayments { /// Passing true requests the capability for the account, if it is not already requested. @@ -3030,6 +3078,42 @@ impl std::default::Default for AccountCapabilitiesCartesBancairesPayments { } } +/// An enum representing the possible values of an `AccountCapabilities`'s `cashapp_payments` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountCapabilitiesCashappPayments { + Active, + Inactive, + Pending, +} + +impl AccountCapabilitiesCashappPayments { + pub fn as_str(self) -> &'static str { + match self { + AccountCapabilitiesCashappPayments::Active => "active", + AccountCapabilitiesCashappPayments::Inactive => "inactive", + AccountCapabilitiesCashappPayments::Pending => "pending", + } + } +} + +impl AsRef for AccountCapabilitiesCashappPayments { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountCapabilitiesCashappPayments { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountCapabilitiesCashappPayments { + fn default() -> Self { + Self::Active + } +} + /// An enum representing the possible values of an `AccountCapabilities`'s `eps_payments` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] diff --git a/src/resources/generated/bank_account.rs b/src/resources/generated/bank_account.rs index ce79bc36e..3f78d92ae 100644 --- a/src/resources/generated/bank_account.rs +++ b/src/resources/generated/bank_account.rs @@ -70,6 +70,10 @@ 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub future_requirements: Option, + /// The last four digits of the bank account number. #[serde(skip_serializing_if = "Option::is_none")] pub last4: Option, @@ -80,6 +84,10 @@ pub struct BankAccount { #[serde(default)] pub metadata: Metadata, + /// Information about the requirements for the bank account, including what information needs to be collected. + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + /// The routing transit number for the bank account. #[serde(skip_serializing_if = "Option::is_none")] pub routing_number: Option, @@ -91,10 +99,11 @@ pub struct BankAccount { /// Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. /// If customer bank account verification has succeeded, the bank account status will be `verified`. /// If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. - /// If a transfer sent to this bank account fails, we'll set the status to `errored` and will not continue to send transfers until the bank details are updated. For external accounts, possible values are `new` and `errored`. - /// Validations aren't run against external accounts because they're only used for payouts. - /// This means the other statuses don't apply. + /// If a transfer sent to this bank account fails, we'll set the status to `errored` and will not continue to send transfers until the bank details are updated. For external accounts, possible values are `new`, `errored` and `verification_failed`. /// If a transfer fails, the status is set to `errored` and transfers are stopped until account details are updated. + /// In India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. + /// Other validations aren't run against external accounts because they're only used for payouts. + /// This means the other statuses don't apply. #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, } @@ -109,6 +118,169 @@ impl Object for BankAccount { } } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ExternalAccountRequirements { + /// Fields that need to be collected to keep the external account enabled. + /// + /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + pub currently_due: Option>, + + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Option>, + + /// Fields that weren't collected by `current_deadline`. + /// + /// These fields need to be collected to enable the external account. + pub past_due: Option>, + + /// Fields that may become required depending on the results of verification or review. + /// + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + pub pending_verification: Option>, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct AccountRequirementsError { + /// The code for the type of error. + pub code: AccountRequirementsErrorCode, + + /// An informative message that indicates the error type and provides additional details about the error. + pub reason: String, + + /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + pub requirement: String, +} + +/// An enum representing the possible values of an `AccountRequirementsError`'s `code` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum AccountRequirementsErrorCode { + InvalidAddressCityStatePostalCode, + #[serde(rename = "invalid_dob_age_under_18")] + InvalidDobAgeUnder18, + InvalidRepresentativeCountry, + InvalidStreetAddress, + InvalidTosAcceptance, + InvalidValueOther, + VerificationDocumentAddressMismatch, + VerificationDocumentAddressMissing, + VerificationDocumentCorrupt, + VerificationDocumentCountryNotSupported, + VerificationDocumentDobMismatch, + VerificationDocumentDuplicateType, + VerificationDocumentExpired, + VerificationDocumentFailedCopy, + VerificationDocumentFailedGreyscale, + VerificationDocumentFailedOther, + VerificationDocumentFailedTestMode, + VerificationDocumentFraudulent, + VerificationDocumentIdNumberMismatch, + VerificationDocumentIdNumberMissing, + VerificationDocumentIncomplete, + VerificationDocumentInvalid, + VerificationDocumentIssueOrExpiryDateMissing, + VerificationDocumentManipulated, + VerificationDocumentMissingBack, + VerificationDocumentMissingFront, + VerificationDocumentNameMismatch, + VerificationDocumentNameMissing, + VerificationDocumentNationalityMismatch, + VerificationDocumentNotReadable, + VerificationDocumentNotSigned, + VerificationDocumentNotUploaded, + VerificationDocumentPhotoMismatch, + VerificationDocumentTooLarge, + VerificationDocumentTypeNotSupported, + VerificationFailedAddressMatch, + VerificationFailedBusinessIecNumber, + VerificationFailedDocumentMatch, + VerificationFailedIdNumberMatch, + VerificationFailedKeyedIdentity, + VerificationFailedKeyedMatch, + VerificationFailedNameMatch, + VerificationFailedOther, + VerificationFailedResidentialAddress, + VerificationFailedTaxIdMatch, + VerificationFailedTaxIdNotIssued, + VerificationMissingExecutives, + VerificationMissingOwners, + VerificationRequiresAdditionalMemorandumOfAssociations, +} + +impl AccountRequirementsErrorCode { + pub fn as_str(self) -> &'static str { + match self { + AccountRequirementsErrorCode::InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code", + AccountRequirementsErrorCode::InvalidDobAgeUnder18 => "invalid_dob_age_under_18", + AccountRequirementsErrorCode::InvalidRepresentativeCountry => "invalid_representative_country", + AccountRequirementsErrorCode::InvalidStreetAddress => "invalid_street_address", + AccountRequirementsErrorCode::InvalidTosAcceptance => "invalid_tos_acceptance", + AccountRequirementsErrorCode::InvalidValueOther => "invalid_value_other", + AccountRequirementsErrorCode::VerificationDocumentAddressMismatch => "verification_document_address_mismatch", + AccountRequirementsErrorCode::VerificationDocumentAddressMissing => "verification_document_address_missing", + AccountRequirementsErrorCode::VerificationDocumentCorrupt => "verification_document_corrupt", + AccountRequirementsErrorCode::VerificationDocumentCountryNotSupported => "verification_document_country_not_supported", + AccountRequirementsErrorCode::VerificationDocumentDobMismatch => "verification_document_dob_mismatch", + AccountRequirementsErrorCode::VerificationDocumentDuplicateType => "verification_document_duplicate_type", + AccountRequirementsErrorCode::VerificationDocumentExpired => "verification_document_expired", + AccountRequirementsErrorCode::VerificationDocumentFailedCopy => "verification_document_failed_copy", + AccountRequirementsErrorCode::VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale", + AccountRequirementsErrorCode::VerificationDocumentFailedOther => "verification_document_failed_other", + AccountRequirementsErrorCode::VerificationDocumentFailedTestMode => "verification_document_failed_test_mode", + AccountRequirementsErrorCode::VerificationDocumentFraudulent => "verification_document_fraudulent", + AccountRequirementsErrorCode::VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch", + AccountRequirementsErrorCode::VerificationDocumentIdNumberMissing => "verification_document_id_number_missing", + AccountRequirementsErrorCode::VerificationDocumentIncomplete => "verification_document_incomplete", + AccountRequirementsErrorCode::VerificationDocumentInvalid => "verification_document_invalid", + AccountRequirementsErrorCode::VerificationDocumentIssueOrExpiryDateMissing => "verification_document_issue_or_expiry_date_missing", + AccountRequirementsErrorCode::VerificationDocumentManipulated => "verification_document_manipulated", + AccountRequirementsErrorCode::VerificationDocumentMissingBack => "verification_document_missing_back", + AccountRequirementsErrorCode::VerificationDocumentMissingFront => "verification_document_missing_front", + AccountRequirementsErrorCode::VerificationDocumentNameMismatch => "verification_document_name_mismatch", + AccountRequirementsErrorCode::VerificationDocumentNameMissing => "verification_document_name_missing", + AccountRequirementsErrorCode::VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch", + AccountRequirementsErrorCode::VerificationDocumentNotReadable => "verification_document_not_readable", + AccountRequirementsErrorCode::VerificationDocumentNotSigned => "verification_document_not_signed", + AccountRequirementsErrorCode::VerificationDocumentNotUploaded => "verification_document_not_uploaded", + AccountRequirementsErrorCode::VerificationDocumentPhotoMismatch => "verification_document_photo_mismatch", + AccountRequirementsErrorCode::VerificationDocumentTooLarge => "verification_document_too_large", + AccountRequirementsErrorCode::VerificationDocumentTypeNotSupported => "verification_document_type_not_supported", + AccountRequirementsErrorCode::VerificationFailedAddressMatch => "verification_failed_address_match", + AccountRequirementsErrorCode::VerificationFailedBusinessIecNumber => "verification_failed_business_iec_number", + AccountRequirementsErrorCode::VerificationFailedDocumentMatch => "verification_failed_document_match", + AccountRequirementsErrorCode::VerificationFailedIdNumberMatch => "verification_failed_id_number_match", + AccountRequirementsErrorCode::VerificationFailedKeyedIdentity => "verification_failed_keyed_identity", + AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", + AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", + AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", + AccountRequirementsErrorCode::VerificationFailedResidentialAddress => "verification_failed_residential_address", + AccountRequirementsErrorCode::VerificationFailedTaxIdMatch => "verification_failed_tax_id_match", + AccountRequirementsErrorCode::VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued", + AccountRequirementsErrorCode::VerificationMissingExecutives => "verification_missing_executives", + AccountRequirementsErrorCode::VerificationMissingOwners => "verification_missing_owners", + AccountRequirementsErrorCode::VerificationRequiresAdditionalMemorandumOfAssociations => "verification_requires_additional_memorandum_of_associations", + } + } +} + +impl AsRef for AccountRequirementsErrorCode { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for AccountRequirementsErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for AccountRequirementsErrorCode { + fn default() -> Self { + Self::InvalidAddressCityStatePostalCode + } +} + /// An enum representing the possible values of an `BankAccount`'s `available_payout_methods` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] diff --git a/src/resources/generated/card.rs b/src/resources/generated/card.rs index a70b2bf14..e0d829a65 100644 --- a/src/resources/generated/card.rs +++ b/src/resources/generated/card.rs @@ -62,7 +62,7 @@ pub struct Card { /// Card brand. /// - /// Can be `American Express`, `Diners Club`, `Discover`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. + /// Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. #[serde(skip_serializing_if = "Option::is_none")] pub brand: Option, diff --git a/src/resources/generated/charge.rs b/src/resources/generated/charge.rs index 777b9af43..5d2c6314c 100644 --- a/src/resources/generated/charge.rs +++ b/src/resources/generated/charge.rs @@ -416,6 +416,9 @@ pub struct PaymentMethodDetails { #[serde(skip_serializing_if = "Option::is_none")] pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub customer_balance: Option, @@ -663,7 +666,7 @@ pub struct PaymentMethodDetailsBoleto { pub struct PaymentMethodDetailsCard { /// Card brand. /// - /// Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. pub brand: Option, /// Check results by Card networks on Card address and CVC at time of payment. @@ -727,7 +730,7 @@ pub struct PaymentMethodDetailsCard { /// Identifies which network this charge was processed on. /// - /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. pub network: Option, /// Populated if this transaction used 3D Secure authentication. @@ -762,7 +765,7 @@ pub struct PaymentMethodDetailsCardPresent { /// Card brand. /// - /// Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + /// 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. @@ -834,7 +837,7 @@ pub struct PaymentMethodDetailsCardPresent { /// Identifies which network this charge was processed on. /// - /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. pub network: Option, /// Defines whether the authorized amount can be over-captured or not. @@ -904,7 +907,7 @@ pub struct PaymentMethodDetailsCardWallet { #[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`, or `visa_checkout`. + /// 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. @@ -981,6 +984,9 @@ pub struct PaymentMethodDetailsCardWalletVisaCheckout { pub shipping_address: Option
, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodDetailsCashapp {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodDetailsCustomerBalance {} @@ -1131,7 +1137,7 @@ pub struct PaymentMethodDetailsInteracPresent { /// Identifies which network this charge was processed on. /// - /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. pub network: Option, /// EMV tag 5F2D. @@ -1207,7 +1213,11 @@ pub struct PaymentMethodDetailsKonbiniStore { } #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsLink {} +pub struct PaymentMethodDetailsLink { + /// Two-letter ISO code representing the funding source country beneath the Link payment. + /// You could use this attribute to get a sense of international fees. + pub country: Option, +} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodDetailsMultibanco { @@ -1924,6 +1934,7 @@ pub enum PaymentMethodDetailsCardWalletType { AmexExpressCheckout, ApplePay, GooglePay, + Link, Masterpass, SamsungPay, VisaCheckout, @@ -1935,6 +1946,7 @@ impl PaymentMethodDetailsCardWalletType { PaymentMethodDetailsCardWalletType::AmexExpressCheckout => "amex_express_checkout", PaymentMethodDetailsCardWalletType::ApplePay => "apple_pay", PaymentMethodDetailsCardWalletType::GooglePay => "google_pay", + PaymentMethodDetailsCardWalletType::Link => "link", PaymentMethodDetailsCardWalletType::Masterpass => "masterpass", PaymentMethodDetailsCardWalletType::SamsungPay => "samsung_pay", PaymentMethodDetailsCardWalletType::VisaCheckout => "visa_checkout", @@ -2249,6 +2261,8 @@ pub enum PaymentMethodDetailsIdealBic { Rabonl2u, #[serde(rename = "RBRBNL21")] Rbrbnl21, + #[serde(rename = "REVOIE23")] + Revoie23, #[serde(rename = "REVOLT21")] Revolt21, #[serde(rename = "SNSBNL2A")] @@ -2271,6 +2285,7 @@ impl PaymentMethodDetailsIdealBic { PaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21", PaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U", PaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21", + PaymentMethodDetailsIdealBic::Revoie23 => "REVOIE23", PaymentMethodDetailsIdealBic::Revolt21 => "REVOLT21", PaymentMethodDetailsIdealBic::Snsbnl2a => "SNSBNL2A", PaymentMethodDetailsIdealBic::Trionl2u => "TRIONL2U", diff --git a/src/resources/generated/checkout_session.rs b/src/resources/generated/checkout_session.rs index fbb8e8b8e..9e5978f84 100644 --- a/src/resources/generated/checkout_session.rs +++ b/src/resources/generated/checkout_session.rs @@ -63,6 +63,9 @@ pub struct CheckoutSession { /// Must be a [supported currency](https://stripe.com/docs/currencies). pub currency: Option, + /// Currency conversion details for automatic currency conversion sessions. + pub currency_conversion: Option, + /// Collect additional information from your customer using custom fields. /// /// Up to 2 fields are supported. @@ -248,6 +251,9 @@ pub struct CheckoutSessionPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub customer_balance: Option, @@ -461,6 +467,17 @@ pub struct CheckoutCardInstallmentsOptions { pub enabled: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CheckoutCashappPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CheckoutCustomerBalancePaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] @@ -720,6 +737,21 @@ pub struct PaymentPagesCheckoutSessionConsentCollection { pub terms_of_service: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentPagesCheckoutSessionCurrencyConversion { + /// Total of all items in source currency before discounts or taxes are applied. + pub amount_subtotal: i64, + + /// Total of all items in source currency after discounts and taxes are applied. + pub amount_total: i64, + + /// Exchange rate used to convert source currency amounts to customer currency amounts. + pub fx_rate: String, + + /// Creation currency of the CheckoutSession before localization. + pub source_currency: Currency, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentPagesCheckoutSessionCustomFields { /// Configuration for `type=dropdown` fields. @@ -1572,6 +1604,10 @@ pub struct CreateCheckoutSessionPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub card: Option, + /// contains details about the Cashapp Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// contains details about the Customer Balance payment method options. #[serde(skip_serializing_if = "Option::is_none")] pub customer_balance: Option, @@ -1891,8 +1927,9 @@ pub struct CreateCheckoutSessionLineItemsPriceData { #[serde(skip_serializing_if = "Option::is_none")] pub recurring: Option, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -2094,6 +2131,18 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsCard { pub statement_descriptor_suffix_kanji: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsCashapp { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalance { /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. @@ -3095,6 +3144,38 @@ impl std::default::Default for CheckoutCardPaymentMethodOptionsSetupFutureUsage } } +/// An enum representing the possible values of an `CheckoutCashappPaymentMethodOptions`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + None, +} + +impl CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CheckoutCashappPaymentMethodOptionsSetupFutureUsage::None => "none", + } + } +} + +impl AsRef for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn default() -> Self { + Self::None + } +} + /// An enum representing the possible values of an `CheckoutCustomerBalanceBankTransferPaymentMethodOptions`'s `requested_address_types` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -4434,6 +4515,7 @@ impl std::default::Default for CreateCheckoutSessionLineItemsPriceDataTaxBehavio #[serde(rename_all = "snake_case")] pub enum CreateCheckoutSessionPaymentIntentDataCaptureMethod { Automatic, + AutomaticAsync, Manual, } @@ -4441,6 +4523,9 @@ impl CreateCheckoutSessionPaymentIntentDataCaptureMethod { pub fn as_str(self) -> &'static str { match self { CreateCheckoutSessionPaymentIntentDataCaptureMethod::Automatic => "automatic", + CreateCheckoutSessionPaymentIntentDataCaptureMethod::AutomaticAsync => { + "automatic_async" + } CreateCheckoutSessionPaymentIntentDataCaptureMethod::Manual => "manual", } } @@ -4987,6 +5072,46 @@ impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsCardSetu } } +/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCashapp`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} + +impl CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::None => "none", + CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::OffSession => { + "off_session" + } + CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::OnSession => { + "on_session" + } + } + } +} + +impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { + fn default() -> Self { + Self::None + } +} + /// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -5749,6 +5874,7 @@ pub enum CreateCheckoutSessionPaymentMethodTypes { Blik, Boleto, Card, + Cashapp, CustomerBalance, Eps, Fpx, @@ -5757,6 +5883,7 @@ pub enum CreateCheckoutSessionPaymentMethodTypes { Ideal, Klarna, Konbini, + Link, Oxxo, P24, Paynow, @@ -5781,6 +5908,7 @@ impl CreateCheckoutSessionPaymentMethodTypes { CreateCheckoutSessionPaymentMethodTypes::Blik => "blik", CreateCheckoutSessionPaymentMethodTypes::Boleto => "boleto", CreateCheckoutSessionPaymentMethodTypes::Card => "card", + CreateCheckoutSessionPaymentMethodTypes::Cashapp => "cashapp", CreateCheckoutSessionPaymentMethodTypes::CustomerBalance => "customer_balance", CreateCheckoutSessionPaymentMethodTypes::Eps => "eps", CreateCheckoutSessionPaymentMethodTypes::Fpx => "fpx", @@ -5789,6 +5917,7 @@ impl CreateCheckoutSessionPaymentMethodTypes { CreateCheckoutSessionPaymentMethodTypes::Ideal => "ideal", CreateCheckoutSessionPaymentMethodTypes::Klarna => "klarna", CreateCheckoutSessionPaymentMethodTypes::Konbini => "konbini", + CreateCheckoutSessionPaymentMethodTypes::Link => "link", CreateCheckoutSessionPaymentMethodTypes::Oxxo => "oxxo", CreateCheckoutSessionPaymentMethodTypes::P24 => "p24", CreateCheckoutSessionPaymentMethodTypes::Paynow => "paynow", diff --git a/src/resources/generated/dispute.rs b/src/resources/generated/dispute.rs index 1a4a131c4..72c15b2ff 100644 --- a/src/resources/generated/dispute.rs +++ b/src/resources/generated/dispute.rs @@ -201,7 +201,7 @@ pub struct DisputeEvidence { pub struct DisputeEvidenceDetails { /// Date by which evidence must be submitted in order to successfully challenge dispute. /// - /// Will be null if the customer's bank or credit card company doesn't allow a response for this particular dispute. + /// Will be 0 if the customer's bank or credit card company doesn't allow a response for this particular dispute. pub due_by: Option, /// Whether evidence has been staged for this dispute. diff --git a/src/resources/generated/identity_verification_report.rs b/src/resources/generated/identity_verification_report.rs index e9ba5da66..7caa8ee18 100644 --- a/src/resources/generated/identity_verification_report.rs +++ b/src/resources/generated/identity_verification_report.rs @@ -29,14 +29,16 @@ pub struct IdentityVerificationReport { /// 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 options: GelatoVerificationReportOptions, + #[serde(skip_serializing_if = "Option::is_none")] + pub options: Option, #[serde(skip_serializing_if = "Option::is_none")] pub selfie: Option, /// Type of report. #[serde(rename = "type")] - pub type_: IdentityVerificationReportType, + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, /// ID of the VerificationSession that created this report. pub verification_session: Option, diff --git a/src/resources/generated/identity_verification_session.rs b/src/resources/generated/identity_verification_session.rs index 91a135255..187d047c2 100644 --- a/src/resources/generated/identity_verification_session.rs +++ b/src/resources/generated/identity_verification_session.rs @@ -44,7 +44,8 @@ pub struct IdentityVerificationSession { /// This can be useful for storing additional information about the object in a structured format. pub metadata: Metadata, - pub options: GelatoVerificationSessionOptions, + /// A set of options for the session’s verification checks. + pub options: Option, /// Redaction status of this VerificationSession. /// @@ -58,7 +59,7 @@ pub struct IdentityVerificationSession { /// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. #[serde(rename = "type")] - pub type_: IdentityVerificationSessionType, + pub type_: Option, /// The short-lived URL that you use to redirect a user to Stripe to submit their identity information. /// diff --git a/src/resources/generated/invoice.rs b/src/resources/generated/invoice.rs index e3bbfc2ab..08e867746 100644 --- a/src/resources/generated/invoice.rs +++ b/src/resources/generated/invoice.rs @@ -898,7 +898,7 @@ pub struct ListInvoices<'a> { /// /// [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, + pub status: Option, /// Only return invoices for the subscription specified by this subscription ID. #[serde(skip_serializing_if = "Option::is_none")] @@ -1776,6 +1776,7 @@ pub enum CreateInvoicePaymentSettingsPaymentMethodTypes { Bancontact, Boleto, Card, + Cashapp, CustomerBalance, Fpx, Giropay, @@ -1805,6 +1806,7 @@ impl CreateInvoicePaymentSettingsPaymentMethodTypes { CreateInvoicePaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", CreateInvoicePaymentSettingsPaymentMethodTypes::Boleto => "boleto", CreateInvoicePaymentSettingsPaymentMethodTypes::Card => "card", + CreateInvoicePaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", CreateInvoicePaymentSettingsPaymentMethodTypes::CustomerBalance => "customer_balance", CreateInvoicePaymentSettingsPaymentMethodTypes::Fpx => "fpx", CreateInvoicePaymentSettingsPaymentMethodTypes::Giropay => "giropay", @@ -2234,7 +2236,6 @@ impl std::default::Default for InvoicePendingInvoiceItemsBehavior { #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] pub enum InvoiceStatus { - Deleted, Draft, Open, Paid, @@ -2245,7 +2246,6 @@ pub enum InvoiceStatus { impl InvoiceStatus { pub fn as_str(self) -> &'static str { match self { - InvoiceStatus::Deleted => "deleted", InvoiceStatus::Draft => "draft", InvoiceStatus::Open => "open", InvoiceStatus::Paid => "paid", @@ -2267,46 +2267,6 @@ impl std::fmt::Display for InvoiceStatus { } } impl std::default::Default for InvoiceStatus { - fn default() -> Self { - Self::Deleted - } -} - -/// An enum representing the possible values of an `ListInvoices`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceStatusFilter { - Draft, - Open, - Paid, - Uncollectible, - Void, -} - -impl InvoiceStatusFilter { - pub fn as_str(self) -> &'static str { - match self { - InvoiceStatusFilter::Draft => "draft", - InvoiceStatusFilter::Open => "open", - InvoiceStatusFilter::Paid => "paid", - InvoiceStatusFilter::Uncollectible => "uncollectible", - InvoiceStatusFilter::Void => "void", - } - } -} - -impl AsRef for InvoiceStatusFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceStatusFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceStatusFilter { fn default() -> Self { Self::Draft } @@ -2324,6 +2284,7 @@ pub enum InvoicesPaymentSettingsPaymentMethodTypes { Bancontact, Boleto, Card, + Cashapp, CustomerBalance, Fpx, Giropay, @@ -2351,6 +2312,7 @@ impl InvoicesPaymentSettingsPaymentMethodTypes { InvoicesPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", InvoicesPaymentSettingsPaymentMethodTypes::Boleto => "boleto", InvoicesPaymentSettingsPaymentMethodTypes::Card => "card", + InvoicesPaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", InvoicesPaymentSettingsPaymentMethodTypes::CustomerBalance => "customer_balance", InvoicesPaymentSettingsPaymentMethodTypes::Fpx => "fpx", InvoicesPaymentSettingsPaymentMethodTypes::Giropay => "giropay", diff --git a/src/resources/generated/invoice_setting_subscription_schedule_setting.rs b/src/resources/generated/invoice_setting_subscription_schedule_setting.rs deleted file mode 100644 index c3fbc0c42..000000000 --- a/src/resources/generated/invoice_setting_subscription_schedule_setting.rs +++ /dev/null @@ -1,15 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "InvoiceSettingSubscriptionScheduleSetting". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleInvoiceSettings { - - /// Number of days within which a customer must pay invoices generated by this subscription schedule. - /// - /// This value will be `null` for subscription schedules where `billing=charge_automatically`. - pub days_until_due: Option, -} diff --git a/src/resources/generated/invoiceitem.rs b/src/resources/generated/invoiceitem.rs index 363c11c26..ddd30974c 100644 --- a/src/resources/generated/invoiceitem.rs +++ b/src/resources/generated/invoiceitem.rs @@ -262,8 +262,9 @@ pub struct CreateInvoiceItem<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub subscription: Option, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -453,8 +454,9 @@ pub struct UpdateInvoiceItem<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub quantity: Option, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -528,8 +530,9 @@ pub struct InvoiceItemPriceData { /// The ID of the product that this price will belong to. pub product: String, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] diff --git a/src/resources/generated/issuing_cardholder.rs b/src/resources/generated/issuing_cardholder.rs index ddbdd89c4..40ae7aa03 100644 --- a/src/resources/generated/issuing_cardholder.rs +++ b/src/resources/generated/issuing_cardholder.rs @@ -62,6 +62,8 @@ pub struct IssuingCardholder { pub status: IssuingCardholderStatus, /// One of `individual` or `company`. + /// + /// See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. #[serde(rename = "type")] pub type_: IssuingCardholderType, } @@ -213,6 +215,8 @@ pub enum IssuingCardholderRequirementsDisabledReason { Listed, #[serde(rename = "rejected.listed")] RejectedListed, + #[serde(rename = "requirements.past_due")] + RequirementsPastDue, UnderReview, } @@ -221,6 +225,9 @@ impl IssuingCardholderRequirementsDisabledReason { match self { IssuingCardholderRequirementsDisabledReason::Listed => "listed", IssuingCardholderRequirementsDisabledReason::RejectedListed => "rejected.listed", + IssuingCardholderRequirementsDisabledReason::RequirementsPastDue => { + "requirements.past_due" + } IssuingCardholderRequirementsDisabledReason::UnderReview => "under_review", } } @@ -249,6 +256,10 @@ impl std::default::Default for IssuingCardholderRequirementsDisabledReason { pub enum IssuingCardholderRequirementsPastDue { #[serde(rename = "company.tax_id")] CompanyTaxId, + #[serde(rename = "individual.card_issuing.user_terms_acceptance.date")] + IndividualCardIssuingUserTermsAcceptanceDate, + #[serde(rename = "individual.card_issuing.user_terms_acceptance.ip")] + IndividualCardIssuingUserTermsAcceptanceIp, #[serde(rename = "individual.dob.day")] IndividualDobDay, #[serde(rename = "individual.dob.month")] @@ -267,6 +278,12 @@ impl IssuingCardholderRequirementsPastDue { pub fn as_str(self) -> &'static str { match self { IssuingCardholderRequirementsPastDue::CompanyTaxId => "company.tax_id", + IssuingCardholderRequirementsPastDue::IndividualCardIssuingUserTermsAcceptanceDate => { + "individual.card_issuing.user_terms_acceptance.date" + } + IssuingCardholderRequirementsPastDue::IndividualCardIssuingUserTermsAcceptanceIp => { + "individual.card_issuing.user_terms_acceptance.ip" + } IssuingCardholderRequirementsPastDue::IndividualDobDay => "individual.dob.day", IssuingCardholderRequirementsPastDue::IndividualDobMonth => "individual.dob.month", IssuingCardholderRequirementsPastDue::IndividualDobYear => "individual.dob.year", diff --git a/src/resources/generated/mandate.rs b/src/resources/generated/mandate.rs index a0df21afd..f289469a9 100644 --- a/src/resources/generated/mandate.rs +++ b/src/resources/generated/mandate.rs @@ -96,6 +96,9 @@ pub struct MandatePaymentMethodDetails { #[serde(skip_serializing_if = "Option::is_none")] pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub link: Option, @@ -169,6 +172,9 @@ pub struct MandateBlik { pub type_: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct MandateCashapp {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct MandateLink {} diff --git a/src/resources/generated/payment_intent.rs b/src/resources/generated/payment_intent.rs index d1860d6d7..2dbec21d2 100644 --- a/src/resources/generated/payment_intent.rs +++ b/src/resources/generated/payment_intent.rs @@ -9,9 +9,9 @@ use crate::ids::{CustomerId, MandateId, PaymentIntentId, PaymentMethodId}; use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; use crate::resources::{ Account, ApiErrors, Application, Charge, Currency, Customer, Invoice, - LinkedAccountOptionsUsBankAccount, PaymentIntentOffSession, PaymentMethod, - PaymentMethodDetailsCardInstallmentsPlan, PaymentMethodOptionsCustomerBalanceEuBankAccount, - PaymentSource, Review, Shipping, + LinkedAccountOptionsUsBankAccount, PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode, + PaymentIntentOffSession, PaymentMethod, PaymentMethodDetailsCardInstallmentsPlan, + PaymentMethodOptionsCustomerBalanceEuBankAccount, PaymentSource, Review, Shipping, }; /// The resource representing a Stripe "PaymentIntent". @@ -272,6 +272,10 @@ pub struct PaymentIntentNextAction { #[serde(skip_serializing_if = "Option::is_none")] pub card_await_notification: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_handle_redirect_or_display_qr_code: + Option, + #[serde(skip_serializing_if = "Option::is_none")] pub display_bank_transfer_instructions: Option, @@ -714,6 +718,9 @@ pub struct PaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub customer_balance: Option, @@ -975,6 +982,10 @@ pub struct PaymentMethodOptionsAffirm { #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, + /// Preferred language of the Affirm authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. @@ -1126,6 +1137,21 @@ pub struct PaymentMethodOptionsCardPresent { pub request_incremental_authorization_support: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodOptionsCashapp { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodOptionsCustomerBalance { #[serde(skip_serializing_if = "Option::is_none")] @@ -1846,6 +1872,10 @@ pub struct CreatePaymentIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub boleto: Option, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. #[serde(skip_serializing_if = "Option::is_none")] pub customer_balance: Option, @@ -1990,6 +2020,10 @@ pub struct CreatePaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub card_present: Option, + /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. #[serde(skip_serializing_if = "Option::is_none")] pub customer_balance: Option, @@ -2159,6 +2193,10 @@ pub struct UpdatePaymentIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub boleto: Option, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. #[serde(skip_serializing_if = "Option::is_none")] pub customer_balance: Option, @@ -2303,6 +2341,10 @@ pub struct UpdatePaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub card_present: Option, + /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. #[serde(skip_serializing_if = "Option::is_none")] pub customer_balance: Option, @@ -2505,6 +2547,9 @@ pub struct CreatePaymentIntentPaymentMethodDataBoleto { pub tax_id: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataCashapp {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodDataCustomerBalance {} @@ -2652,6 +2697,10 @@ pub struct CreatePaymentIntentPaymentMethodOptionsAffirm { #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, + /// Preferred language of the Affirm authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. @@ -2856,6 +2905,25 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCardPresent { pub request_incremental_authorization_support: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCashapp { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalance { /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. @@ -3274,6 +3342,9 @@ pub struct UpdatePaymentIntentPaymentMethodDataBoleto { pub tax_id: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataCashapp {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodDataCustomerBalance {} @@ -3421,6 +3492,10 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsAffirm { #[serde(skip_serializing_if = "Option::is_none")] pub capture_method: Option, + /// Preferred language of the Affirm authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. /// /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. @@ -3625,6 +3700,25 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresent { pub request_incremental_authorization_support: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCashapp { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalance { /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. @@ -4846,6 +4940,7 @@ pub enum CreatePaymentIntentPaymentMethodDataType { Bancontact, Blik, Boleto, + Cashapp, CustomerBalance, Eps, Fpx, @@ -4878,6 +4973,7 @@ impl CreatePaymentIntentPaymentMethodDataType { CreatePaymentIntentPaymentMethodDataType::Bancontact => "bancontact", CreatePaymentIntentPaymentMethodDataType::Blik => "blik", CreatePaymentIntentPaymentMethodDataType::Boleto => "boleto", + CreatePaymentIntentPaymentMethodDataType::Cashapp => "cashapp", CreatePaymentIntentPaymentMethodDataType::CustomerBalance => "customer_balance", CreatePaymentIntentPaymentMethodDataType::Eps => "eps", CreatePaymentIntentPaymentMethodDataType::Fpx => "fpx", @@ -5851,6 +5947,78 @@ impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardSetupF } } +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCashapp`'s `capture_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + Manual, +} + +impl CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + +/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCashapp`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} + +impl CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::None => "none", + CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OffSession => { + "off_session" + } + CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OnSession => { + "on_session" + } + } + } +} + +impl AsRef for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn default() -> Self { + Self::None + } +} + /// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -7130,6 +7298,7 @@ impl std::default::Default for PaymentIntentCancellationReason { #[serde(rename_all = "snake_case")] pub enum PaymentIntentCaptureMethod { Automatic, + AutomaticAsync, Manual, } @@ -7137,6 +7306,7 @@ impl PaymentIntentCaptureMethod { pub fn as_str(self) -> &'static str { match self { PaymentIntentCaptureMethod::Automatic => "automatic", + PaymentIntentCaptureMethod::AutomaticAsync => "automatic_async", PaymentIntentCaptureMethod::Manual => "manual", } } @@ -8397,6 +8567,74 @@ impl std::default::Default for PaymentMethodOptionsCardMandateOptionsSupportedTy } } +/// An enum representing the possible values of an `PaymentMethodOptionsCashapp`'s `capture_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentMethodOptionsCashappCaptureMethod { + Manual, +} + +impl PaymentMethodOptionsCashappCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + PaymentMethodOptionsCashappCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for PaymentMethodOptionsCashappCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentMethodOptionsCashappCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + +/// An enum representing the possible values of an `PaymentMethodOptionsCashapp`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} + +impl PaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + PaymentMethodOptionsCashappSetupFutureUsage::None => "none", + PaymentMethodOptionsCashappSetupFutureUsage::OffSession => "off_session", + PaymentMethodOptionsCashappSetupFutureUsage::OnSession => "on_session", + } + } +} + +impl AsRef for PaymentMethodOptionsCashappSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentMethodOptionsCashappSetupFutureUsage { + fn default() -> Self { + Self::None + } +} + /// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -9512,6 +9750,7 @@ pub enum UpdatePaymentIntentPaymentMethodDataType { Bancontact, Blik, Boleto, + Cashapp, CustomerBalance, Eps, Fpx, @@ -9544,6 +9783,7 @@ impl UpdatePaymentIntentPaymentMethodDataType { UpdatePaymentIntentPaymentMethodDataType::Bancontact => "bancontact", UpdatePaymentIntentPaymentMethodDataType::Blik => "blik", UpdatePaymentIntentPaymentMethodDataType::Boleto => "boleto", + UpdatePaymentIntentPaymentMethodDataType::Cashapp => "cashapp", UpdatePaymentIntentPaymentMethodDataType::CustomerBalance => "customer_balance", UpdatePaymentIntentPaymentMethodDataType::Eps => "eps", UpdatePaymentIntentPaymentMethodDataType::Fpx => "fpx", @@ -10517,6 +10757,78 @@ impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardSetupF } } +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCashapp`'s `capture_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + Manual, +} + +impl UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::Manual => "manual", + } + } +} + +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn default() -> Self { + Self::Manual + } +} + +/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCashapp`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} + +impl UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::None => "none", + UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OffSession => { + "off_session" + } + UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OnSession => { + "on_session" + } + } + } +} + +impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn default() -> Self { + Self::None + } +} + /// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] diff --git a/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs b/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs new file mode 100644 index 000000000..029b162ee --- /dev/null +++ b/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs @@ -0,0 +1,31 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +use crate::params::Timestamp; + +/// The resource representing a Stripe "PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode { + /// The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. + pub hosted_instructions_url: String, + + /// The url for mobile redirect based auth. + pub mobile_auth_url: String, + + pub qr_code: PaymentIntentNextActionCashappQrCode, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentIntentNextActionCashappQrCode { + /// The date (unix timestamp) when the QR code expires. + pub expires_at: Timestamp, + + /// The image_url_png string used to render QR code. + pub image_url_png: String, + + /// The image_url_svg string used to render QR code. + pub image_url_svg: String, +} diff --git a/src/resources/generated/payment_link.rs b/src/resources/generated/payment_link.rs index ef57745e8..77bd312da 100644 --- a/src/resources/generated/payment_link.rs +++ b/src/resources/generated/payment_link.rs @@ -1441,6 +1441,7 @@ impl std::default::Default #[serde(rename_all = "snake_case")] pub enum CreatePaymentLinkPaymentIntentDataCaptureMethod { Automatic, + AutomaticAsync, Manual, } @@ -1448,6 +1449,7 @@ impl CreatePaymentLinkPaymentIntentDataCaptureMethod { pub fn as_str(self) -> &'static str { match self { CreatePaymentLinkPaymentIntentDataCaptureMethod::Automatic => "automatic", + CreatePaymentLinkPaymentIntentDataCaptureMethod::AutomaticAsync => "automatic_async", CreatePaymentLinkPaymentIntentDataCaptureMethod::Manual => "manual", } } @@ -1517,6 +1519,7 @@ pub enum CreatePaymentLinkPaymentMethodTypes { Blik, Boleto, Card, + Cashapp, Eps, Fpx, Giropay, @@ -1524,6 +1527,7 @@ pub enum CreatePaymentLinkPaymentMethodTypes { Ideal, Klarna, Konbini, + Link, Oxxo, P24, Paynow, @@ -1547,6 +1551,7 @@ impl CreatePaymentLinkPaymentMethodTypes { CreatePaymentLinkPaymentMethodTypes::Blik => "blik", CreatePaymentLinkPaymentMethodTypes::Boleto => "boleto", CreatePaymentLinkPaymentMethodTypes::Card => "card", + CreatePaymentLinkPaymentMethodTypes::Cashapp => "cashapp", CreatePaymentLinkPaymentMethodTypes::Eps => "eps", CreatePaymentLinkPaymentMethodTypes::Fpx => "fpx", CreatePaymentLinkPaymentMethodTypes::Giropay => "giropay", @@ -1554,6 +1559,7 @@ impl CreatePaymentLinkPaymentMethodTypes { CreatePaymentLinkPaymentMethodTypes::Ideal => "ideal", CreatePaymentLinkPaymentMethodTypes::Klarna => "klarna", CreatePaymentLinkPaymentMethodTypes::Konbini => "konbini", + CreatePaymentLinkPaymentMethodTypes::Link => "link", CreatePaymentLinkPaymentMethodTypes::Oxxo => "oxxo", CreatePaymentLinkPaymentMethodTypes::P24 => "p24", CreatePaymentLinkPaymentMethodTypes::Paynow => "paynow", @@ -2440,6 +2446,7 @@ pub enum PaymentLinkPaymentMethodTypes { Blik, Boleto, Card, + Cashapp, Eps, Fpx, Giropay, @@ -2447,6 +2454,7 @@ pub enum PaymentLinkPaymentMethodTypes { Ideal, Klarna, Konbini, + Link, Oxxo, P24, Paynow, @@ -2470,6 +2478,7 @@ impl PaymentLinkPaymentMethodTypes { PaymentLinkPaymentMethodTypes::Blik => "blik", PaymentLinkPaymentMethodTypes::Boleto => "boleto", PaymentLinkPaymentMethodTypes::Card => "card", + PaymentLinkPaymentMethodTypes::Cashapp => "cashapp", PaymentLinkPaymentMethodTypes::Eps => "eps", PaymentLinkPaymentMethodTypes::Fpx => "fpx", PaymentLinkPaymentMethodTypes::Giropay => "giropay", @@ -2477,6 +2486,7 @@ impl PaymentLinkPaymentMethodTypes { PaymentLinkPaymentMethodTypes::Ideal => "ideal", PaymentLinkPaymentMethodTypes::Klarna => "klarna", PaymentLinkPaymentMethodTypes::Konbini => "konbini", + PaymentLinkPaymentMethodTypes::Link => "link", PaymentLinkPaymentMethodTypes::Oxxo => "oxxo", PaymentLinkPaymentMethodTypes::P24 => "p24", PaymentLinkPaymentMethodTypes::Paynow => "paynow", @@ -2720,6 +2730,7 @@ impl std::default::Default for PaymentLinksResourceCustomFieldsType { #[serde(rename_all = "snake_case")] pub enum PaymentLinksResourcePaymentIntentDataCaptureMethod { Automatic, + AutomaticAsync, Manual, } @@ -2727,6 +2738,7 @@ impl PaymentLinksResourcePaymentIntentDataCaptureMethod { pub fn as_str(self) -> &'static str { match self { PaymentLinksResourcePaymentIntentDataCaptureMethod::Automatic => "automatic", + PaymentLinksResourcePaymentIntentDataCaptureMethod::AutomaticAsync => "automatic_async", PaymentLinksResourcePaymentIntentDataCaptureMethod::Manual => "manual", } } @@ -3677,6 +3689,7 @@ pub enum UpdatePaymentLinkPaymentMethodTypes { Blik, Boleto, Card, + Cashapp, Eps, Fpx, Giropay, @@ -3684,6 +3697,7 @@ pub enum UpdatePaymentLinkPaymentMethodTypes { Ideal, Klarna, Konbini, + Link, Oxxo, P24, Paynow, @@ -3707,6 +3721,7 @@ impl UpdatePaymentLinkPaymentMethodTypes { UpdatePaymentLinkPaymentMethodTypes::Blik => "blik", UpdatePaymentLinkPaymentMethodTypes::Boleto => "boleto", UpdatePaymentLinkPaymentMethodTypes::Card => "card", + UpdatePaymentLinkPaymentMethodTypes::Cashapp => "cashapp", UpdatePaymentLinkPaymentMethodTypes::Eps => "eps", UpdatePaymentLinkPaymentMethodTypes::Fpx => "fpx", UpdatePaymentLinkPaymentMethodTypes::Giropay => "giropay", @@ -3714,6 +3729,7 @@ impl UpdatePaymentLinkPaymentMethodTypes { UpdatePaymentLinkPaymentMethodTypes::Ideal => "ideal", UpdatePaymentLinkPaymentMethodTypes::Klarna => "klarna", UpdatePaymentLinkPaymentMethodTypes::Konbini => "konbini", + UpdatePaymentLinkPaymentMethodTypes::Link => "link", UpdatePaymentLinkPaymentMethodTypes::Oxxo => "oxxo", UpdatePaymentLinkPaymentMethodTypes::P24 => "p24", UpdatePaymentLinkPaymentMethodTypes::Paynow => "paynow", diff --git a/src/resources/generated/payment_method.rs b/src/resources/generated/payment_method.rs index c72c0f941..3d840d699 100644 --- a/src/resources/generated/payment_method.rs +++ b/src/resources/generated/payment_method.rs @@ -54,6 +54,9 @@ pub struct PaymentMethod { #[serde(skip_serializing_if = "Option::is_none")] pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// Time at which the object was created. /// /// Measured in seconds since the Unix epoch. @@ -263,7 +266,7 @@ pub struct PaymentMethodBoleto { pub struct CardDetails { /// Card brand. /// - /// Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. pub brand: String, /// Checks on Card address and CVC if provided. @@ -367,7 +370,7 @@ pub struct WalletDetails { #[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`, or `visa_checkout`. + /// 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. @@ -444,6 +447,9 @@ pub struct WalletVisaCheckout { pub shipping_address: Option
, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodCashapp {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodCustomerBalance {} @@ -511,6 +517,12 @@ pub struct PaymentMethodKonbini {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodLink { + /// Two-letter ISO code representing the funding source (i.e. + /// + /// card, bank) country beneath the Link payment method. You could use this attribute to get a sense of the international breakdown of funding sources you've collected. + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + /// Account owner's email address. pub email: Option, @@ -596,6 +608,25 @@ pub struct PaymentMethodUsBankAccount { /// Routing number of the bank account. pub routing_number: Option, + + /// Contains information about the future reusability of this PaymentMethod. + #[serde(skip_serializing_if = "Option::is_none")] + 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)] @@ -676,6 +707,10 @@ pub struct CreatePaymentMethod<'a> { #[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, @@ -801,6 +836,7 @@ impl<'a> CreatePaymentMethod<'a> { blik: Default::default(), boleto: Default::default(), card: Default::default(), + cashapp: Default::default(), customer: Default::default(), customer_balance: Default::default(), eps: Default::default(), @@ -929,6 +965,12 @@ pub struct UpdatePaymentMethod<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub card: Option, + /// This is a legacy parameter that will be removed in the future. + /// + /// It is a hash that does not accept any keys. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// Specifies which fields in the response should be expanded. #[serde(skip_serializing_if = "Expand::is_empty")] pub expand: &'a [&'a str], @@ -966,6 +1008,7 @@ impl<'a> UpdatePaymentMethod<'a> { billing_details: Default::default(), blik: Default::default(), card: Default::default(), + cashapp: Default::default(), expand: Default::default(), link: Default::default(), metadata: Default::default(), @@ -1030,6 +1073,9 @@ pub struct CreatePaymentMethodBoleto { pub tax_id: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodCashapp {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentMethodCustomerBalance {} @@ -1160,6 +1206,9 @@ pub struct UpdatePaymentMethodBacsDebit {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentMethodBlik {} +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodCashapp {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentMethodLink {} @@ -1935,6 +1984,8 @@ pub enum PaymentMethodIdealBic { Rabonl2u, #[serde(rename = "RBRBNL21")] Rbrbnl21, + #[serde(rename = "REVOIE23")] + Revoie23, #[serde(rename = "REVOLT21")] Revolt21, #[serde(rename = "SNSBNL2A")] @@ -1957,6 +2008,7 @@ impl PaymentMethodIdealBic { PaymentMethodIdealBic::Moyonl21 => "MOYONL21", PaymentMethodIdealBic::Rabonl2u => "RABONL2U", PaymentMethodIdealBic::Rbrbnl21 => "RBRBNL21", + PaymentMethodIdealBic::Revoie23 => "REVOIE23", PaymentMethodIdealBic::Revolt21 => "REVOLT21", PaymentMethodIdealBic::Snsbnl2a => "SNSBNL2A", PaymentMethodIdealBic::Trionl2u => "TRIONL2U", @@ -2076,6 +2128,7 @@ pub enum PaymentMethodType { Boleto, Card, CardPresent, + Cashapp, CustomerBalance, Eps, Fpx, @@ -2111,6 +2164,7 @@ impl PaymentMethodType { PaymentMethodType::Boleto => "boleto", PaymentMethodType::Card => "card", PaymentMethodType::CardPresent => "card_present", + PaymentMethodType::Cashapp => "cashapp", PaymentMethodType::CustomerBalance => "customer_balance", PaymentMethodType::Eps => "eps", PaymentMethodType::Fpx => "fpx", @@ -2166,6 +2220,7 @@ pub enum PaymentMethodTypeFilter { Boleto, Card, CardPresent, + Cashapp, CustomerBalance, Eps, Fpx, @@ -2200,6 +2255,7 @@ impl PaymentMethodTypeFilter { PaymentMethodTypeFilter::Boleto => "boleto", PaymentMethodTypeFilter::Card => "card", PaymentMethodTypeFilter::CardPresent => "card_present", + PaymentMethodTypeFilter::Cashapp => "cashapp", PaymentMethodTypeFilter::CustomerBalance => "customer_balance", PaymentMethodTypeFilter::Eps => "eps", PaymentMethodTypeFilter::Fpx => "fpx", @@ -2307,6 +2363,118 @@ impl std::default::Default for PaymentMethodUsBankAccountAccountType { } } +/// 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")] @@ -2382,6 +2550,7 @@ pub enum WalletDetailsType { AmexExpressCheckout, ApplePay, GooglePay, + Link, Masterpass, SamsungPay, VisaCheckout, @@ -2393,6 +2562,7 @@ impl WalletDetailsType { 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", diff --git a/src/resources/generated/price.rs b/src/resources/generated/price.rs index 46090c68b..2fa024d62 100644 --- a/src/resources/generated/price.rs +++ b/src/resources/generated/price.rs @@ -85,8 +85,9 @@ pub struct Price { #[serde(skip_serializing_if = "Option::is_none")] pub recurring: Option, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -171,8 +172,9 @@ pub struct CurrencyOption { /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. pub custom_unit_amount: Option, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. /// + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. /// One of `inclusive`, `exclusive`, or `unspecified`. /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. pub tax_behavior: Option, @@ -318,8 +320,9 @@ pub struct CreatePrice<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub recurring: Option, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -510,8 +513,9 @@ pub struct UpdatePrice<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub recurring: Option, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -544,8 +548,9 @@ pub struct CreatePriceCurrencyOptions { #[serde(skip_serializing_if = "Option::is_none")] pub custom_unit_amount: Option, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -728,8 +733,9 @@ pub struct UpdatePriceCurrencyOptions { #[serde(skip_serializing_if = "Option::is_none")] pub custom_unit_amount: Option, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] diff --git a/src/resources/generated/product.rs b/src/resources/generated/product.rs index 73ea96226..7224dfa5a 100644 --- a/src/resources/generated/product.rs +++ b/src/resources/generated/product.rs @@ -515,8 +515,9 @@ pub struct CreateProductDefaultPriceData { #[serde(skip_serializing_if = "Option::is_none")] pub recurring: Option, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -541,8 +542,9 @@ pub struct CreateProductDefaultPriceDataCurrencyOptions { #[serde(skip_serializing_if = "Option::is_none")] pub custom_unit_amount: Option, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] diff --git a/src/resources/generated/refund.rs b/src/resources/generated/refund.rs index 9035c5ca4..26c340d89 100644 --- a/src/resources/generated/refund.rs +++ b/src/resources/generated/refund.rs @@ -53,7 +53,7 @@ pub struct Refund { #[serde(skip_serializing_if = "Option::is_none")] pub failure_reason: Option, - /// Email to which refund instructions, if required, are sent to. + /// For payment methods without native refund support (e.g., Konbini, PromptPay), email for the customer to receive refund instructions. #[serde(skip_serializing_if = "Option::is_none")] pub instructions_email: Option, @@ -181,7 +181,7 @@ pub struct CreateRefund<'a> { #[serde(skip_serializing_if = "Expand::is_empty")] pub expand: &'a [&'a str], - /// Address to send refund email, use customer email if not specified. + /// For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions. #[serde(skip_serializing_if = "Option::is_none")] pub instructions_email: Option<&'a str>, diff --git a/src/resources/generated/setup_attempt.rs b/src/resources/generated/setup_attempt.rs index 78ab957ce..3889c9b92 100644 --- a/src/resources/generated/setup_attempt.rs +++ b/src/resources/generated/setup_attempt.rs @@ -114,6 +114,9 @@ pub struct SetupAttemptPaymentMethodDetails { #[serde(skip_serializing_if = "Option::is_none")] pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub ideal: Option, @@ -198,6 +201,9 @@ pub struct SetupAttemptPaymentMethodDetailsCardPresent { pub generated_card: Option>, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SetupAttemptPaymentMethodDetailsCashapp {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupAttemptPaymentMethodDetailsIdeal { /// The customer's bank. @@ -479,6 +485,8 @@ pub enum SetupAttemptPaymentMethodDetailsIdealBic { Rabonl2u, #[serde(rename = "RBRBNL21")] Rbrbnl21, + #[serde(rename = "REVOIE23")] + Revoie23, #[serde(rename = "REVOLT21")] Revolt21, #[serde(rename = "SNSBNL2A")] @@ -501,6 +509,7 @@ impl SetupAttemptPaymentMethodDetailsIdealBic { SetupAttemptPaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21", SetupAttemptPaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U", SetupAttemptPaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21", + SetupAttemptPaymentMethodDetailsIdealBic::Revoie23 => "REVOIE23", SetupAttemptPaymentMethodDetailsIdealBic::Revolt21 => "REVOLT21", SetupAttemptPaymentMethodDetailsIdealBic::Snsbnl2a => "SNSBNL2A", SetupAttemptPaymentMethodDetailsIdealBic::Trionl2u => "TRIONL2U", diff --git a/src/resources/generated/setup_intent.rs b/src/resources/generated/setup_intent.rs index bde60f0f6..b77e277c7 100644 --- a/src/resources/generated/setup_intent.rs +++ b/src/resources/generated/setup_intent.rs @@ -9,7 +9,8 @@ use crate::ids::{CustomerId, PaymentMethodId, SetupIntentId}; use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; use crate::resources::{ Account, ApiErrors, Application, Currency, Customer, LinkedAccountOptionsUsBankAccount, - Mandate, MandateOptionsOffSessionDetailsBlik, PaymentMethod, SetupAttempt, + Mandate, MandateOptionsOffSessionDetailsBlik, + PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode, PaymentMethod, SetupAttempt, }; /// The resource representing a Stripe "SetupIntent". @@ -31,6 +32,9 @@ pub struct SetupIntent { #[serde(skip_serializing_if = "Option::is_none")] pub attach_to_self: Option, + /// Settings for automatic payment methods compatible with this Setup Intent. + pub automatic_payment_methods: Option, + /// Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. pub cancellation_reason: Option, @@ -158,8 +162,18 @@ impl Object for SetupIntent { } } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentFlowsAutomaticPaymentMethodsSetupIntent { + /// Automatically calculates compatible payment methods. + pub enabled: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupIntentNextAction { + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_handle_redirect_or_display_qr_code: + Option, + #[serde(skip_serializing_if = "Option::is_none")] pub redirect_to_url: Option, @@ -385,6 +399,10 @@ pub struct CreateSetupIntent<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub attach_to_self: Option, + /// When enabled, this SetupIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this SetupIntent's other parameters. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_payment_methods: Option, + /// Set to `true` to attempt to confirm this SetupIntent immediately. /// /// This parameter defaults to `false`. @@ -473,6 +491,7 @@ impl<'a> CreateSetupIntent<'a> { pub fn new() -> Self { CreateSetupIntent { attach_to_self: Default::default(), + automatic_payment_methods: Default::default(), confirm: Default::default(), customer: Default::default(), description: Default::default(), @@ -645,6 +664,12 @@ impl<'a> UpdateSetupIntent<'a> { } } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSetupIntentAutomaticPaymentMethods { + /// Whether this feature is enabled. + pub enabled: bool, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentMandateData { /// This hash contains details about the customer acceptance of the Mandate. @@ -693,6 +718,10 @@ pub struct CreateSetupIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub boleto: Option, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. #[serde(skip_serializing_if = "Option::is_none")] pub customer_balance: Option, @@ -875,6 +904,10 @@ pub struct UpdateSetupIntentPaymentMethodData { #[serde(skip_serializing_if = "Option::is_none")] pub boleto: Option, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. #[serde(skip_serializing_if = "Option::is_none")] pub customer_balance: Option, @@ -1095,6 +1128,9 @@ pub struct CreateSetupIntentPaymentMethodDataBoleto { pub tax_id: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSetupIntentPaymentMethodDataCashapp {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentPaymentMethodDataCustomerBalance {} @@ -1374,6 +1410,9 @@ pub struct UpdateSetupIntentPaymentMethodDataBoleto { pub tax_id: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataCashapp {} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSetupIntentPaymentMethodDataCustomerBalance {} @@ -2390,6 +2429,7 @@ pub enum CreateSetupIntentPaymentMethodDataType { Bancontact, Blik, Boleto, + Cashapp, CustomerBalance, Eps, Fpx, @@ -2422,6 +2462,7 @@ impl CreateSetupIntentPaymentMethodDataType { CreateSetupIntentPaymentMethodDataType::Bancontact => "bancontact", CreateSetupIntentPaymentMethodDataType::Blik => "blik", CreateSetupIntentPaymentMethodDataType::Boleto => "boleto", + CreateSetupIntentPaymentMethodDataType::Cashapp => "cashapp", CreateSetupIntentPaymentMethodDataType::CustomerBalance => "customer_balance", CreateSetupIntentPaymentMethodDataType::Eps => "eps", CreateSetupIntentPaymentMethodDataType::Fpx => "fpx", @@ -4032,6 +4073,7 @@ pub enum UpdateSetupIntentPaymentMethodDataType { Bancontact, Blik, Boleto, + Cashapp, CustomerBalance, Eps, Fpx, @@ -4064,6 +4106,7 @@ impl UpdateSetupIntentPaymentMethodDataType { UpdateSetupIntentPaymentMethodDataType::Bancontact => "bancontact", UpdateSetupIntentPaymentMethodDataType::Blik => "blik", UpdateSetupIntentPaymentMethodDataType::Boleto => "boleto", + UpdateSetupIntentPaymentMethodDataType::Cashapp => "cashapp", UpdateSetupIntentPaymentMethodDataType::CustomerBalance => "customer_balance", UpdateSetupIntentPaymentMethodDataType::Eps => "eps", UpdateSetupIntentPaymentMethodDataType::Fpx => "fpx", diff --git a/src/resources/generated/subscription.rs b/src/resources/generated/subscription.rs index c37717a6a..bd840738d 100644 --- a/src/resources/generated/subscription.rs +++ b/src/resources/generated/subscription.rs @@ -1306,8 +1306,9 @@ pub struct InvoiceItemPriceData { /// The ID of the product that this price will belong to. pub product: String, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -1337,8 +1338,9 @@ pub struct SubscriptionItemPriceData { /// The recurring components of a price such as `interval` and `interval_count`. pub recurring: SubscriptionItemPriceDataRecurring, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -2120,6 +2122,7 @@ pub enum CreateSubscriptionPaymentSettingsPaymentMethodTypes { Bancontact, Boleto, Card, + Cashapp, CustomerBalance, Fpx, Giropay, @@ -2149,6 +2152,7 @@ impl CreateSubscriptionPaymentSettingsPaymentMethodTypes { CreateSubscriptionPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", CreateSubscriptionPaymentSettingsPaymentMethodTypes::Boleto => "boleto", CreateSubscriptionPaymentSettingsPaymentMethodTypes::Card => "card", + CreateSubscriptionPaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", CreateSubscriptionPaymentSettingsPaymentMethodTypes::CustomerBalance => { "customer_balance" } @@ -2742,6 +2746,7 @@ pub enum SubscriptionsResourcePaymentSettingsPaymentMethodTypes { Bancontact, Boleto, Card, + Cashapp, CustomerBalance, Fpx, Giropay, @@ -2771,6 +2776,7 @@ impl SubscriptionsResourcePaymentSettingsPaymentMethodTypes { SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Boleto => "boleto", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Card => "card", + SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", SubscriptionsResourcePaymentSettingsPaymentMethodTypes::CustomerBalance => { "customer_balance" } @@ -3324,6 +3330,7 @@ pub enum UpdateSubscriptionPaymentSettingsPaymentMethodTypes { Bancontact, Boleto, Card, + Cashapp, CustomerBalance, Fpx, Giropay, @@ -3353,6 +3360,7 @@ impl UpdateSubscriptionPaymentSettingsPaymentMethodTypes { UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Boleto => "boleto", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Card => "card", + UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", UpdateSubscriptionPaymentSettingsPaymentMethodTypes::CustomerBalance => { "customer_balance" } diff --git a/src/resources/generated/subscription_item.rs b/src/resources/generated/subscription_item.rs index 266902e4f..7fd7174d2 100644 --- a/src/resources/generated/subscription_item.rs +++ b/src/resources/generated/subscription_item.rs @@ -368,8 +368,9 @@ pub struct SubscriptionItemPriceData { /// The recurring components of a price such as `interval` and `interval_count`. pub recurring: SubscriptionItemPriceDataRecurring, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] diff --git a/src/resources/generated/subscription_schedule.rs b/src/resources/generated/subscription_schedule.rs index 1dac859b0..e1cf19b53 100644 --- a/src/resources/generated/subscription_schedule.rs +++ b/src/resources/generated/subscription_schedule.rs @@ -200,7 +200,7 @@ pub struct SubscriptionSchedulePhaseConfiguration { pub end_date: Timestamp, /// The invoice settings applicable during this phase. - pub invoice_settings: Option, + pub invoice_settings: Option, /// Subscription items to configure the subscription to during this phase of the subscription schedule. pub items: Vec, @@ -231,6 +231,14 @@ pub struct SubscriptionSchedulePhaseConfiguration { pub trial_end: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct InvoiceSettingPhaseSetting { + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// + /// This value will be `null` for subscription schedules where `billing=charge_automatically`. + pub days_until_due: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SchedulesPhaseAutomaticTax { /// Whether Stripe automatically computes tax on invoices created during this phase. @@ -1055,8 +1063,9 @@ pub struct CreateSubscriptionSchedulePhasesItemsPriceData { /// The recurring components of a price such as `interval` and `interval_count`. pub recurring: CreateSubscriptionSchedulePhasesItemsPriceDataRecurring, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -1083,8 +1092,9 @@ pub struct InvoiceItemPriceData { /// The ID of the product that this price will belong to. pub product: String, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] @@ -1120,8 +1130,9 @@ pub struct UpdateSubscriptionSchedulePhasesItemsPriceData { /// The recurring components of a price such as `interval` and `interval_count`. pub recurring: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring, - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// 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")] diff --git a/src/resources/generated/tax_calculation.rs b/src/resources/generated/tax_calculation.rs new file mode 100644 index 000000000..b649f4386 --- /dev/null +++ b/src/resources/generated/tax_calculation.rs @@ -0,0 +1,147 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{TaxCalculationId}; +use crate::params::{List, Object, Timestamp}; +use crate::resources::{Currency, TaxCalculationLineItem, TaxProductResourceCustomerDetails, TaxProductResourceShippingCost}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "TaxProductResourceTaxCalculation". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxCalculation { + /// Unique identifier for the calculation. + pub id: TaxCalculationId, + + /// Total after taxes. + pub amount_total: i64, + + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: Currency, + + /// The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. + pub customer: Option, + + pub customer_details: TaxProductResourceCustomerDetails, + + /// Timestamp of date at which the tax calculation will expire. + pub expires_at: Option, + + /// The list of items the customer is purchasing. + pub line_items: 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, + + /// The shipping cost details for the calculation. + pub shipping_cost: Option, + + /// The amount of tax to be collected on top of the line item prices. + pub tax_amount_exclusive: i64, + + /// The amount of tax already included in the line item prices. + pub tax_amount_inclusive: i64, + + /// Breakdown of individual tax amounts that add up to the total. + pub tax_breakdown: Vec, + + /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. + pub tax_date: Timestamp, +} + +impl Object for TaxCalculation { + type Id = TaxCalculationId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "tax.calculation" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceTaxBreakdown { + + /// The amount of tax, in integer cents. + pub amount: i64, + + /// Specifies whether the tax amount is included in the line item amount. + pub inclusive: bool, + + pub tax_rate_details: TaxProductResourceTaxRateDetails, + + /// The amount on which tax is calculated, in integer cents. + pub taxable_amount: i64, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceTaxRateDetails { + + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: Option, + + /// The tax rate percentage as a string. + /// + /// For example, 8.5% is represented as `"8.5"`. + pub percentage_decimal: String, + + /// State, county, province, or region. + pub state: Option, + + /// The tax type, such as `vat` or `sales_tax`. + pub tax_type: Option, +} + +/// An enum representing the possible values of an `TaxProductResourceTaxRateDetails`'s `tax_type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxProductResourceTaxRateDetailsTaxType { + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + Vat, +} + +impl TaxProductResourceTaxRateDetailsTaxType { + pub fn as_str(self) -> &'static str { + match self { + TaxProductResourceTaxRateDetailsTaxType::Gst => "gst", + TaxProductResourceTaxRateDetailsTaxType::Hst => "hst", + TaxProductResourceTaxRateDetailsTaxType::Igst => "igst", + TaxProductResourceTaxRateDetailsTaxType::Jct => "jct", + TaxProductResourceTaxRateDetailsTaxType::LeaseTax => "lease_tax", + TaxProductResourceTaxRateDetailsTaxType::Pst => "pst", + TaxProductResourceTaxRateDetailsTaxType::Qst => "qst", + TaxProductResourceTaxRateDetailsTaxType::Rst => "rst", + TaxProductResourceTaxRateDetailsTaxType::SalesTax => "sales_tax", + TaxProductResourceTaxRateDetailsTaxType::Vat => "vat", + } + } +} + +impl AsRef for TaxProductResourceTaxRateDetailsTaxType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxProductResourceTaxRateDetailsTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxProductResourceTaxRateDetailsTaxType { + fn default() -> Self { + Self::Gst + } +} diff --git a/src/resources/generated/tax_calculation_line_item.rs b/src/resources/generated/tax_calculation_line_item.rs new file mode 100644 index 000000000..13b58242e --- /dev/null +++ b/src/resources/generated/tax_calculation_line_item.rs @@ -0,0 +1,336 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{TaxCalculationLineItemId}; +use crate::params::{Object}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "TaxProductResourceTaxCalculationLineItem". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxCalculationLineItem { + /// Unique identifier for the object. + pub id: TaxCalculationLineItemId, + + /// The line item amount in integer cents. + /// + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes were calculated on top of this amount. + pub amount: i64, + + /// The amount of tax calculated for this line item, in integer cents. + pub amount_tax: i64, + + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + + /// A Product ID. + pub product: Option, + + /// The number of units of the item being purchased. + /// + /// For reversals, this is the quantity reversed. + pub quantity: u64, + + /// A custom identifier for this line item. + pub reference: Option, + + /// Specifies whether the `amount` includes taxes. + /// + /// If `tax_behavior=inclusive`, then the amount includes taxes. + pub tax_behavior: TaxCalculationLineItemTaxBehavior, + + /// Detailed account of taxes relevant to this line item. + pub tax_breakdown: Option>, + + /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. + pub tax_code: String, +} + +impl Object for TaxCalculationLineItem { + type Id = TaxCalculationLineItemId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "tax.calculation_line_item" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceLineItemTaxBreakdown { + + /// The amount of tax, in integer cents. + pub amount: i64, + + pub jurisdiction: TaxProductResourceJurisdiction, + + /// Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). + pub sourcing: TaxProductResourceLineItemTaxBreakdownSourcing, + + /// Details regarding the rate for this tax. + /// + /// This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. + pub tax_rate_details: Option, + + /// The reasoning behind this tax, for example, if the product is tax exempt. + /// + /// The possible values for this field may be extended as new tax rules are supported. + pub taxability_reason: TaxProductResourceLineItemTaxBreakdownTaxabilityReason, + + /// The amount on which tax is calculated, in integer cents. + pub taxable_amount: i64, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceJurisdiction { + + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + + /// A human-readable name for the jurisdiction imposing the tax. + pub display_name: String, + + /// Indicates the level of the jurisdiction imposing the tax. + pub level: TaxProductResourceJurisdictionLevel, + + /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. + /// + /// For example, "NY" for New York, United States. + pub state: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceLineItemTaxRateDetails { + + /// A localized display name for tax type, intended to be human-readable. + /// + /// For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". + pub display_name: String, + + /// The tax rate percentage as a string. + /// + /// For example, 8.5% is represented as "8.5". + pub percentage_decimal: String, + + /// The tax type, such as `vat` or `sales_tax`. + pub tax_type: TaxProductResourceLineItemTaxRateDetailsTaxType, +} + +/// An enum representing the possible values of an `TaxCalculationLineItem`'s `tax_behavior` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxCalculationLineItemTaxBehavior { + Exclusive, + Inclusive, +} + +impl TaxCalculationLineItemTaxBehavior { + pub fn as_str(self) -> &'static str { + match self { + TaxCalculationLineItemTaxBehavior::Exclusive => "exclusive", + TaxCalculationLineItemTaxBehavior::Inclusive => "inclusive", + } + } +} + +impl AsRef for TaxCalculationLineItemTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxCalculationLineItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxCalculationLineItemTaxBehavior { + fn default() -> Self { + Self::Exclusive + } +} + +/// An enum representing the possible values of an `TaxProductResourceJurisdiction`'s `level` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxProductResourceJurisdictionLevel { + City, + Country, + County, + District, + State, +} + +impl TaxProductResourceJurisdictionLevel { + pub fn as_str(self) -> &'static str { + match self { + TaxProductResourceJurisdictionLevel::City => "city", + TaxProductResourceJurisdictionLevel::Country => "country", + TaxProductResourceJurisdictionLevel::County => "county", + TaxProductResourceJurisdictionLevel::District => "district", + TaxProductResourceJurisdictionLevel::State => "state", + } + } +} + +impl AsRef for TaxProductResourceJurisdictionLevel { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxProductResourceJurisdictionLevel { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxProductResourceJurisdictionLevel { + fn default() -> Self { + Self::City + } +} + +/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `sourcing` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxProductResourceLineItemTaxBreakdownSourcing { + Destination, + Origin, +} + +impl TaxProductResourceLineItemTaxBreakdownSourcing { + pub fn as_str(self) -> &'static str { + match self { + TaxProductResourceLineItemTaxBreakdownSourcing::Destination => "destination", + TaxProductResourceLineItemTaxBreakdownSourcing::Origin => "origin", + } + } +} + +impl AsRef for TaxProductResourceLineItemTaxBreakdownSourcing { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownSourcing { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxProductResourceLineItemTaxBreakdownSourcing { + fn default() -> Self { + Self::Destination + } +} + +/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `taxability_reason` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + CustomerExempt, + NotCollecting, + NotSubjectToTax, + NotSupported, + PortionProductExempt, + PortionReducedRated, + PortionStandardRated, + ProductExempt, + ProductExemptHoliday, + ProportionallyRated, + ReducedRated, + ReverseCharge, + StandardRated, + TaxableBasisReduced, + ZeroRated, +} + +impl TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + pub fn as_str(self) -> &'static str { + match self { + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::CustomerExempt => "customer_exempt", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotCollecting => "not_collecting", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSupported => "not_supported", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionProductExempt => "portion_product_exempt", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionReducedRated => "portion_reduced_rated", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionStandardRated => "portion_standard_rated", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExempt => "product_exempt", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProportionallyRated => "proportionally_rated", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReducedRated => "reduced_rated", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReverseCharge => "reverse_charge", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::StandardRated => "standard_rated", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", + TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ZeroRated => "zero_rated", + } + } +} + +impl AsRef for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn default() -> Self { + Self::CustomerExempt + } +} + +/// An enum representing the possible values of an `TaxProductResourceLineItemTaxRateDetails`'s `tax_type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + Vat, +} + +impl TaxProductResourceLineItemTaxRateDetailsTaxType { + pub fn as_str(self) -> &'static str { + match self { + TaxProductResourceLineItemTaxRateDetailsTaxType::Gst => "gst", + TaxProductResourceLineItemTaxRateDetailsTaxType::Hst => "hst", + TaxProductResourceLineItemTaxRateDetailsTaxType::Igst => "igst", + TaxProductResourceLineItemTaxRateDetailsTaxType::Jct => "jct", + TaxProductResourceLineItemTaxRateDetailsTaxType::LeaseTax => "lease_tax", + TaxProductResourceLineItemTaxRateDetailsTaxType::Pst => "pst", + TaxProductResourceLineItemTaxRateDetailsTaxType::Qst => "qst", + TaxProductResourceLineItemTaxRateDetailsTaxType::Rst => "rst", + TaxProductResourceLineItemTaxRateDetailsTaxType::SalesTax => "sales_tax", + TaxProductResourceLineItemTaxRateDetailsTaxType::Vat => "vat", + } + } +} + +impl AsRef for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn default() -> Self { + Self::Gst + } +} diff --git a/src/resources/generated/tax_product_resource_customer_details.rs b/src/resources/generated/tax_product_resource_customer_details.rs new file mode 100644 index 000000000..7f63c8c02 --- /dev/null +++ b/src/resources/generated/tax_product_resource_customer_details.rs @@ -0,0 +1,264 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "TaxProductResourceCustomerDetails". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceCustomerDetails { + + /// The customer's postal address (for example, home or business location). + pub address: Option, + + /// The type of customer address provided. + pub address_source: Option, + + /// The customer's IP address (IPv4 or IPv6). + pub ip_address: Option, + + /// The customer's tax IDs (for example, EU VAT numbers). + pub tax_ids: Vec, + + /// The taxability override used for taxation. + pub taxability_override: TaxProductResourceCustomerDetailsTaxabilityOverride, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceCustomerDetailsResourceTaxId { + + /// The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `eu_oss_vat`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. + #[serde(rename = "type")] + pub type_: TaxProductResourceCustomerDetailsResourceTaxIdType, + + /// The value of the tax ID. + pub value: String, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourcePostalAddress { + + /// City, district, suburb, town, or village. + pub city: Option, + + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: Option, + + /// Address line 2 (e.g., apartment, suite, unit, or building). + pub line2: Option, + + /// ZIP or postal code. + pub postal_code: Option, + + /// State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. + /// + /// Example: "NY" or "TX". + pub state: Option, +} + +/// An enum representing the possible values of an `TaxProductResourceCustomerDetails`'s `address_source` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxProductResourceCustomerDetailsAddressSource { + Billing, + Shipping, +} + +impl TaxProductResourceCustomerDetailsAddressSource { + pub fn as_str(self) -> &'static str { + match self { + TaxProductResourceCustomerDetailsAddressSource::Billing => "billing", + TaxProductResourceCustomerDetailsAddressSource::Shipping => "shipping", + } + } +} + +impl AsRef for TaxProductResourceCustomerDetailsAddressSource { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxProductResourceCustomerDetailsAddressSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxProductResourceCustomerDetailsAddressSource { + fn default() -> Self { + Self::Billing + } +} + +/// An enum representing the possible values of an `TaxProductResourceCustomerDetailsResourceTaxId`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxProductResourceCustomerDetailsResourceTaxIdType { + AeTrn, + AuAbn, + AuArn, + BgUic, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PhTin, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + ThVat, + TrTin, + TwVat, + UaVat, + Unknown, + UsEin, + ZaVat, +} + +impl TaxProductResourceCustomerDetailsResourceTaxIdType { + pub fn as_str(self) -> &'static str { + match self { + TaxProductResourceCustomerDetailsResourceTaxIdType::AeTrn => "ae_trn", + TaxProductResourceCustomerDetailsResourceTaxIdType::AuAbn => "au_abn", + TaxProductResourceCustomerDetailsResourceTaxIdType::AuArn => "au_arn", + TaxProductResourceCustomerDetailsResourceTaxIdType::BgUic => "bg_uic", + TaxProductResourceCustomerDetailsResourceTaxIdType::BrCnpj => "br_cnpj", + TaxProductResourceCustomerDetailsResourceTaxIdType::BrCpf => "br_cpf", + TaxProductResourceCustomerDetailsResourceTaxIdType::CaBn => "ca_bn", + TaxProductResourceCustomerDetailsResourceTaxIdType::CaGstHst => "ca_gst_hst", + TaxProductResourceCustomerDetailsResourceTaxIdType::CaPstBc => "ca_pst_bc", + TaxProductResourceCustomerDetailsResourceTaxIdType::CaPstMb => "ca_pst_mb", + TaxProductResourceCustomerDetailsResourceTaxIdType::CaPstSk => "ca_pst_sk", + TaxProductResourceCustomerDetailsResourceTaxIdType::CaQst => "ca_qst", + TaxProductResourceCustomerDetailsResourceTaxIdType::ChVat => "ch_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::ClTin => "cl_tin", + TaxProductResourceCustomerDetailsResourceTaxIdType::EgTin => "eg_tin", + TaxProductResourceCustomerDetailsResourceTaxIdType::EsCif => "es_cif", + TaxProductResourceCustomerDetailsResourceTaxIdType::EuOssVat => "eu_oss_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::EuVat => "eu_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::GbVat => "gb_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::GeVat => "ge_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::HkBr => "hk_br", + TaxProductResourceCustomerDetailsResourceTaxIdType::HuTin => "hu_tin", + TaxProductResourceCustomerDetailsResourceTaxIdType::IdNpwp => "id_npwp", + TaxProductResourceCustomerDetailsResourceTaxIdType::IlVat => "il_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::InGst => "in_gst", + TaxProductResourceCustomerDetailsResourceTaxIdType::IsVat => "is_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::JpCn => "jp_cn", + TaxProductResourceCustomerDetailsResourceTaxIdType::JpRn => "jp_rn", + TaxProductResourceCustomerDetailsResourceTaxIdType::JpTrn => "jp_trn", + TaxProductResourceCustomerDetailsResourceTaxIdType::KePin => "ke_pin", + TaxProductResourceCustomerDetailsResourceTaxIdType::KrBrn => "kr_brn", + TaxProductResourceCustomerDetailsResourceTaxIdType::LiUid => "li_uid", + TaxProductResourceCustomerDetailsResourceTaxIdType::MxRfc => "mx_rfc", + TaxProductResourceCustomerDetailsResourceTaxIdType::MyFrp => "my_frp", + TaxProductResourceCustomerDetailsResourceTaxIdType::MyItn => "my_itn", + TaxProductResourceCustomerDetailsResourceTaxIdType::MySst => "my_sst", + TaxProductResourceCustomerDetailsResourceTaxIdType::NoVat => "no_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::NzGst => "nz_gst", + TaxProductResourceCustomerDetailsResourceTaxIdType::PhTin => "ph_tin", + TaxProductResourceCustomerDetailsResourceTaxIdType::RuInn => "ru_inn", + TaxProductResourceCustomerDetailsResourceTaxIdType::RuKpp => "ru_kpp", + TaxProductResourceCustomerDetailsResourceTaxIdType::SaVat => "sa_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::SgGst => "sg_gst", + TaxProductResourceCustomerDetailsResourceTaxIdType::SgUen => "sg_uen", + TaxProductResourceCustomerDetailsResourceTaxIdType::SiTin => "si_tin", + TaxProductResourceCustomerDetailsResourceTaxIdType::ThVat => "th_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::TrTin => "tr_tin", + TaxProductResourceCustomerDetailsResourceTaxIdType::TwVat => "tw_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::UaVat => "ua_vat", + TaxProductResourceCustomerDetailsResourceTaxIdType::Unknown => "unknown", + TaxProductResourceCustomerDetailsResourceTaxIdType::UsEin => "us_ein", + TaxProductResourceCustomerDetailsResourceTaxIdType::ZaVat => "za_vat", + } + } +} + +impl AsRef for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn default() -> Self { + Self::AeTrn + } +} + +/// An enum representing the possible values of an `TaxProductResourceCustomerDetails`'s `taxability_override` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxProductResourceCustomerDetailsTaxabilityOverride { + CustomerExempt, + None, + ReverseCharge, +} + +impl TaxProductResourceCustomerDetailsTaxabilityOverride { + pub fn as_str(self) -> &'static str { + match self { + TaxProductResourceCustomerDetailsTaxabilityOverride::CustomerExempt => "customer_exempt", + TaxProductResourceCustomerDetailsTaxabilityOverride::None => "none", + TaxProductResourceCustomerDetailsTaxabilityOverride::ReverseCharge => "reverse_charge", + } + } +} + +impl AsRef for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn default() -> Self { + Self::CustomerExempt + } +} diff --git a/src/resources/generated/tax_product_resource_shipping_cost.rs b/src/resources/generated/tax_product_resource_shipping_cost.rs new file mode 100644 index 000000000..6d6702914 --- /dev/null +++ b/src/resources/generated/tax_product_resource_shipping_cost.rs @@ -0,0 +1,65 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "TaxProductResourceShippingCost". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceShippingCost { + + /// The shipping amount in integer cents. + /// + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes were calculated on top of this amount. + pub amount: i64, + + /// The amount of tax calculated for shipping, in integer cents. + pub amount_tax: i64, + + /// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option, + + /// Specifies whether the `amount` includes taxes. + /// + /// If `tax_behavior=inclusive`, then the amount includes taxes. + pub tax_behavior: TaxProductResourceShippingCostTaxBehavior, + + /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. + pub tax_code: String, +} + +/// An enum representing the possible values of an `TaxProductResourceShippingCost`'s `tax_behavior` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxProductResourceShippingCostTaxBehavior { + Exclusive, + Inclusive, +} + +impl TaxProductResourceShippingCostTaxBehavior { + pub fn as_str(self) -> &'static str { + match self { + TaxProductResourceShippingCostTaxBehavior::Exclusive => "exclusive", + TaxProductResourceShippingCostTaxBehavior::Inclusive => "inclusive", + } + } +} + +impl AsRef for TaxProductResourceShippingCostTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxProductResourceShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxProductResourceShippingCostTaxBehavior { + fn default() -> Self { + Self::Exclusive + } +} diff --git a/src/resources/generated/tax_transaction.rs b/src/resources/generated/tax_transaction.rs new file mode 100644 index 000000000..d5cdf4d6c --- /dev/null +++ b/src/resources/generated/tax_transaction.rs @@ -0,0 +1,110 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{TaxTransactionId}; +use crate::params::{List, Metadata, Object, Timestamp}; +use crate::resources::{Currency, TaxProductResourceCustomerDetails, TaxProductResourceShippingCost, TaxTransactionLineItem}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "TaxProductResourceTaxTransaction". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxTransaction { + /// Unique identifier for the transaction. + pub id: TaxTransactionId, + + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: Timestamp, + + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: Currency, + + /// The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. + pub customer: Option, + + pub customer_details: TaxProductResourceCustomerDetails, + + /// The tax collected or refunded, by line item. + pub line_items: List, + + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Metadata, + + /// A custom unique identifier, such as 'myOrder_123'. + pub reference: String, + + /// If `type=reversal`, contains information about what was reversed. + pub reversal: Option, + + /// The shipping cost details for the transaction. + pub shipping_cost: Option, + + /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. + pub tax_date: Timestamp, + + /// If `reversal`, this transaction reverses an earlier transaction. + #[serde(rename = "type")] + pub type_: TaxTransactionType, +} + +impl Object for TaxTransaction { + type Id = TaxTransactionId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "tax.transaction" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceTaxTransactionResourceReversal { + + /// The `id` of the reversed `Transaction` object. + pub original_transaction: Option, +} + +/// An enum representing the possible values of an `TaxTransaction`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxTransactionType { + Reversal, + Transaction, +} + +impl TaxTransactionType { + pub fn as_str(self) -> &'static str { + match self { + TaxTransactionType::Reversal => "reversal", + TaxTransactionType::Transaction => "transaction", + } + } +} + +impl AsRef for TaxTransactionType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxTransactionType { + fn default() -> Self { + Self::Reversal + } +} diff --git a/src/resources/generated/tax_transaction_line_item.rs b/src/resources/generated/tax_transaction_line_item.rs new file mode 100644 index 000000000..a9a47e0e3 --- /dev/null +++ b/src/resources/generated/tax_transaction_line_item.rs @@ -0,0 +1,139 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::ids::{TaxTransactionLineItemId}; +use crate::params::{Metadata, Object}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "TaxProductResourceTaxTransactionLineItem". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxTransactionLineItem { + /// Unique identifier for the object. + pub id: TaxTransactionLineItemId, + + /// The line item amount in integer cents. + /// + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes were calculated on top of this amount. + pub amount: i64, + + /// The amount of tax calculated for this line item, in integer cents. + pub amount_tax: i64, + + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Metadata, + + /// The number of units of the item being purchased. + /// + /// For reversals, this is the quantity reversed. + pub quantity: u64, + + /// A custom identifier for this line item in the transaction. + pub reference: String, + + /// If `type=reversal`, contains information about what was reversed. + pub reversal: Option, + + /// Specifies whether the `amount` includes taxes. + /// + /// If `tax_behavior=inclusive`, then the amount includes taxes. + pub tax_behavior: TaxTransactionLineItemTaxBehavior, + + /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. + pub tax_code: String, + + /// If `reversal`, this line item reverses an earlier transaction. + #[serde(rename = "type")] + pub type_: TaxTransactionLineItemType, +} + +impl Object for TaxTransactionLineItem { + type Id = TaxTransactionLineItemId; + fn id(&self) -> Self::Id { + self.id.clone() + } + fn object(&self) -> &'static str { + "tax.transaction_line_item" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceTaxTransactionLineItemResourceReversal { + + /// The `id` of the line item to reverse in the original transaction. + pub original_line_item: String, +} + +/// An enum representing the possible values of an `TaxTransactionLineItem`'s `tax_behavior` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxTransactionLineItemTaxBehavior { + Exclusive, + Inclusive, +} + +impl TaxTransactionLineItemTaxBehavior { + pub fn as_str(self) -> &'static str { + match self { + TaxTransactionLineItemTaxBehavior::Exclusive => "exclusive", + TaxTransactionLineItemTaxBehavior::Inclusive => "inclusive", + } + } +} + +impl AsRef for TaxTransactionLineItemTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxTransactionLineItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxTransactionLineItemTaxBehavior { + fn default() -> Self { + Self::Exclusive + } +} + +/// An enum representing the possible values of an `TaxTransactionLineItem`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxTransactionLineItemType { + Reversal, + Transaction, +} + +impl TaxTransactionLineItemType { + pub fn as_str(self) -> &'static str { + match self { + TaxTransactionLineItemType::Reversal => "reversal", + TaxTransactionLineItemType::Transaction => "transaction", + } + } +} + +impl AsRef for TaxTransactionLineItemType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxTransactionLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxTransactionLineItemType { + fn default() -> Self { + Self::Reversal + } +} diff --git a/src/resources/generated/webhook_endpoint.rs b/src/resources/generated/webhook_endpoint.rs index ec935c37c..ec11fd825 100644 --- a/src/resources/generated/webhook_endpoint.rs +++ b/src/resources/generated/webhook_endpoint.rs @@ -519,6 +519,8 @@ pub enum EventFilter { PayoutFailed, #[serde(rename = "payout.paid")] PayoutPaid, + #[serde(rename = "payout.reconciliation_completed")] + PayoutReconciliationCompleted, #[serde(rename = "payout.updated")] PayoutUpdated, #[serde(rename = "person.created")] @@ -885,6 +887,7 @@ impl EventFilter { EventFilter::PayoutCreated => "payout.created", EventFilter::PayoutFailed => "payout.failed", EventFilter::PayoutPaid => "payout.paid", + EventFilter::PayoutReconciliationCompleted => "payout.reconciliation_completed", EventFilter::PayoutUpdated => "payout.updated", EventFilter::PersonCreated => "person.created", EventFilter::PersonDeleted => "person.deleted",