diff --git a/openapi/version.json b/openapi/version.json index af8db4260..5412e4a74 100644 --- a/openapi/version.json +++ b/openapi/version.json @@ -1,3 +1,3 @@ { - "version": "v318" + "version": "v322" } \ No newline at end of file diff --git a/src/resources.rs b/src/resources.rs index b844eda60..d52aaa819 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -125,6 +125,8 @@ pub use { payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code::*, linked_account_options_us_bank_account::*, payment_method_details_card_checks::*, + payment_method_details_card_wallet_apple_pay::*, + payment_method_details_card_wallet_google_pay::*, payment_method_options_customer_balance_eu_bank_account::*, payout::*, platform_tax_fee::*, diff --git a/src/resources/generated.rs b/src/resources/generated.rs index fce3b3232..7f647351c 100644 --- a/src/resources/generated.rs +++ b/src/resources/generated.rs @@ -31,6 +31,8 @@ pub mod core { pub mod payment_intent; pub mod payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code; pub mod payment_method_details_card_checks; + pub mod payment_method_details_card_wallet_apple_pay; + pub mod payment_method_details_card_wallet_google_pay; pub mod payment_method_options_customer_balance_eu_bank_account; pub mod payout; pub mod platform_tax_fee; diff --git a/src/resources/generated/account.rs b/src/resources/generated/account.rs index 294e95977..765ccc880 100644 --- a/src/resources/generated/account.rs +++ b/src/resources/generated/account.rs @@ -2692,6 +2692,7 @@ pub struct TransferScheduleParams { /// May also be set to `minimum`, representing the lowest available value for the account country. /// Default is `minimum`. /// The `delay_days` parameter does not apply when the `interval` is `manual`. + /// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). #[serde(skip_serializing_if = "Option::is_none")] pub delay_days: Option, diff --git a/src/resources/generated/charge.rs b/src/resources/generated/charge.rs index db92d8f90..17a1e8ddd 100644 --- a/src/resources/generated/charge.rs +++ b/src/resources/generated/charge.rs @@ -11,7 +11,8 @@ use crate::resources::{ Account, Address, Application, ApplicationFee, BalanceTransaction, BillingDetails, ChargeSourceParams, Currency, Customer, Dispute, Invoice, Mandate, PaymentIntent, PaymentMethod, PaymentMethodDetailsCardChecks, PaymentMethodDetailsCardInstallmentsPlan, - PaymentSource, RadarRadarOptions, Refund, Review, Shipping, ThreeDSecureDetails, Transfer, + PaymentMethodDetailsCardWalletApplePay, PaymentMethodDetailsCardWalletGooglePay, PaymentSource, + RadarRadarOptions, Refund, Review, Shipping, ThreeDSecureDetails, Transfer, }; /// The resource representing a Stripe "Charge". @@ -909,12 +910,6 @@ pub struct PaymentMethodDetailsCardWallet { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodDetailsCardWalletAmexExpressCheckout {} -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletApplePay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletGooglePay {} - #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodDetailsCardWalletMasterpass { /// Owner's verified billing address. diff --git a/src/resources/generated/checkout_session.rs b/src/resources/generated/checkout_session.rs index 0d61d8a4b..b53e7237e 100644 --- a/src/resources/generated/checkout_session.rs +++ b/src/resources/generated/checkout_session.rs @@ -278,6 +278,9 @@ pub struct CheckoutSessionPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub konbini: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub oxxo: Option, @@ -596,6 +599,17 @@ pub struct CheckoutKonbiniPaymentMethodOptions { pub setup_future_usage: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CheckoutLinkPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CheckoutOxxoPaymentMethodOptions { /// The number of calendar days before an OXXO invoice expires. @@ -1640,6 +1654,10 @@ pub struct CreateCheckoutSessionPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub konbini: Option, + /// contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + /// contains details about the OXXO payment method options. #[serde(skip_serializing_if = "Option::is_none")] pub oxxo: Option, @@ -2262,6 +2280,17 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsKonbini { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsLink { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionPaymentMethodOptionsOxxo { /// The number of calendar days before an OXXO voucher expires. @@ -3568,6 +3597,40 @@ impl std::default::Default for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsa } } +/// An enum representing the possible values of an `CheckoutLinkPaymentMethodOptions`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, +} + +impl CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CheckoutLinkPaymentMethodOptionsSetupFutureUsage::None => "none", + CheckoutLinkPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", + } + } +} + +impl AsRef for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn default() -> Self { + Self::None + } +} + /// An enum representing the possible values of an `CheckoutOxxoPaymentMethodOptions`'s `setup_future_usage` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -5506,6 +5569,42 @@ impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsKonbiniS } } +/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsLink`'s `setup_future_usage` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { + None, + OffSession, +} + +impl CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::None => "none", + CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::OffSession => { + "off_session" + } + } + } +} + +impl AsRef for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { + fn default() -> Self { + Self::None + } +} + /// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsOxxo`'s `setup_future_usage` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] diff --git a/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs b/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs new file mode 100644 index 000000000..4785e2e29 --- /dev/null +++ b/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs @@ -0,0 +1,9 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_details_card_wallet_apple_pay". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodDetailsCardWalletApplePay {} diff --git a/src/resources/generated/payment_method_details_card_wallet_google_pay.rs b/src/resources/generated/payment_method_details_card_wallet_google_pay.rs new file mode 100644 index 000000000..36af4281c --- /dev/null +++ b/src/resources/generated/payment_method_details_card_wallet_google_pay.rs @@ -0,0 +1,9 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "payment_method_details_card_wallet_google_pay". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentMethodDetailsCardWalletGooglePay {} diff --git a/src/resources/generated/setup_attempt.rs b/src/resources/generated/setup_attempt.rs index 4e4558b4d..f43b9fdbb 100644 --- a/src/resources/generated/setup_attempt.rs +++ b/src/resources/generated/setup_attempt.rs @@ -9,7 +9,8 @@ use crate::ids::{SetupAttemptId, SetupIntentId}; use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp}; use crate::resources::{ Account, ApiErrors, Application, Customer, Mandate, PaymentMethod, - PaymentMethodDetailsCardChecks, SetupIntent, ThreeDSecureDetails, + PaymentMethodDetailsCardChecks, PaymentMethodDetailsCardWalletApplePay, + PaymentMethodDetailsCardWalletGooglePay, SetupIntent, ThreeDSecureDetails, }; /// The resource representing a Stripe "PaymentFlowsSetupIntentSetupAttempt". @@ -191,11 +192,68 @@ pub struct SetupAttemptPaymentMethodDetailsBoleto {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupAttemptPaymentMethodDetailsCard { - /// Check results by Card networks on Card address and CVC at time of payment. + /// Card brand. + /// + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub brand: Option, + + /// Check results by Card networks on Card address and CVC at the time of authorization. pub checks: Option, + /// Two-letter ISO code representing the country of the card. + /// + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + + /// A high-level description of the type of cards issued in this range. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + /// Two-digit number representing the card's expiration month. + pub exp_month: Option, + + /// Four-digit number representing the card's expiration year. + pub exp_year: Option, + + /// Uniquely identifies this particular card number. + /// + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*. + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + + /// Card funding type. + /// + /// Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: Option, + + /// Issuer identification number of the card. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + + /// The name of the card's issuing bank. + /// + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + + /// The last four digits of the card. + pub last4: Option, + + /// Identifies which network this charge was processed on. + /// + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub network: Option, + /// Populated if this authorization used 3D Secure authentication. pub three_d_secure: Option, + + /// If this Card is part of a card wallet, this contains the details of the card wallet. + pub wallet: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -204,6 +262,22 @@ pub struct SetupAttemptPaymentMethodDetailsCardPresent { pub generated_card: Option>, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SetupAttemptPaymentMethodDetailsCardWallet { + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + + /// The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. + /// + /// An additional hash is included on the Wallet subhash with a name matching this value. + /// It contains additional information specific to the card wallet type. + #[serde(rename = "type")] + pub type_: SetupAttemptPaymentMethodDetailsCardWalletType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupAttemptPaymentMethodDetailsCashapp {} @@ -404,6 +478,42 @@ impl std::default::Default for SetupAttemptPaymentMethodDetailsBancontactPreferr } } +/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsCardWallet`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum SetupAttemptPaymentMethodDetailsCardWalletType { + ApplePay, + GooglePay, + Link, +} + +impl SetupAttemptPaymentMethodDetailsCardWalletType { + pub fn as_str(self) -> &'static str { + match self { + SetupAttemptPaymentMethodDetailsCardWalletType::ApplePay => "apple_pay", + SetupAttemptPaymentMethodDetailsCardWalletType::GooglePay => "google_pay", + SetupAttemptPaymentMethodDetailsCardWalletType::Link => "link", + } + } +} + +impl AsRef for SetupAttemptPaymentMethodDetailsCardWalletType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for SetupAttemptPaymentMethodDetailsCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for SetupAttemptPaymentMethodDetailsCardWalletType { + fn default() -> Self { + Self::ApplePay + } +} + /// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsIdeal`'s `bank` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")]